abi
abi14mo ago

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?
0 Replies
No replies yetBe the first to reply to this messageJoin