DenoDDeno
Powered by
abiA
Denoβ€’3y ago
abi

Import from direct URL works fine, but NOT via deps.ts

// ./lib/foobar1.ts
// everything is fine
import { z } from "https://deno.land/x/zod@v3.21.4/mod.ts"
const foobar = z.string()
type Foobar1 = z.infer<typeof foobar>
// ./lib/foobar1.ts
// everything is fine
import { z } from "https://deno.land/x/zod@v3.21.4/mod.ts"
const foobar = z.string()
type Foobar1 = z.infer<typeof foobar>


...but...

// ./deps.ts
export * as zod from "https://deno.land/x/zod@v3.21.4/mod.ts"

// ./lib/foobar2.ts
import { zod } from "../deps.ts"
const { z } = zod
const foobar = z.string()  // works :)
type Foobar1 = z.infer<typeof foobar>  // Cannot find namespace 'z'.
// ./deps.ts
export * as zod from "https://deno.land/x/zod@v3.21.4/mod.ts"

// ./lib/foobar2.ts
import { zod } from "../deps.ts"
const { z } = zod
const foobar = z.string()  // works :)
type Foobar1 = z.infer<typeof foobar>  // Cannot find namespace 'z'.


any ideas?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

imports or deps.ts
cypkeCcypke / help
17mo ago
deps.ts & importMap.json
dan.the.discloserDdan.the.discloser / help
4y ago