D
Deno

help

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

Aabi4/26/2023
// ./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?

Looking for more? Join the community!