In Bun environments, using "string.url" directly in arkenv config causes a TypeScript error:
Type '"string.url"' is not assignable to type '"Reference to submodule 'string.url' must specify an alias"'.
Current behavior:
import arkenv from "arkenv";
const env = arkenv({
TURSO_DATABASE_URL: "string.url", // ❌ TypeScript error in Bun
});
Expected behavior:
Should work the same as in Node.js, where "string.url" is accepted without errors.
Environment:
- ✅ Works in Node.js v24
- ❌ Fails in Bun v1.2.22 and v1.3.2
- Type-level issue only (runtime validation works correctly)
Workaround:
Users can use "string.url" as "string" or import type from arktype directly, but this shouldn't be necessary.
Root cause identified: This issue occurs when tsconfig.json uses module: "commonjs". See #378 for the consolidated issue.
Related:
In Bun environments, using
"string.url"directly in arkenv config causes a TypeScript error:Current behavior:
Expected behavior:
Should work the same as in Node.js, where
"string.url"is accepted without errors.Environment:
Workaround:
Users can use
"string.url" as "string"or importtypefromarktypedirectly, but this shouldn't be necessary.Root cause identified: This issue occurs when
tsconfig.jsonusesmodule: "commonjs". See #378 for the consolidated issue.Related:
moduleResolution: "Node10"or"Node"in tsconfig #378 (root cause - TypeScript type errors withmodule: "commonjs")