-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Hello there,
The following code:
import { parseEnv } from 'znv';
import { z } from 'zod';
export const {
DEFAULT_ADMIN_EMAILS,
} = parseEnv(process.env, {
DEFAULT_ADMIN_EMAILS: z
.string()
.optional()
.transform((val) => {
return val ? val.split(',') : [];
}),
});
yields the following TypeScript warning:
The inferred type of 'DEFAULT_ADMIN_EMAILS' cannot be named without a reference to '../node_modules/znv/dist/util'. This is likely not portable. A type annotation is necessary.
Has anyone encountered the same thing? Not really sure how to fix this. I am using Bun. My tsconfig:
{
"compilerOptions": {
"lib": ["ESNext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"allowImportingTsExtensions": true,
"moduleDetection": "force",
"jsx": "react",
"jsxFactory": "Html.createElement",
"jsxFragmentFactory": "Html.Fragment",
"baseUrl": "./src",
"paths": {
"~/*": ["./src/*"]
},
"types": [
"bun-types",
"typed-htmx"
],
"allowJs": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"composite": true,
"downlevelIteration": true,
"allowSyntheticDefaultImports": true
}
}
Thank you!
cometkim and mamlzy
Metadata
Metadata
Assignees
Labels
No labels