Open ghost opened 1 year ago
Try add this two options into tsconfig.json
{
"compilerOptions": {
// ...
"module": "ESNext",
"moduleResolution": "node",
// ...
}
}
I tried it and had the same output, only this time, I tried to execute from within the "examples" folder of this repository, so another error was added into the fold:
> nest@0.0.1 start /home/stanley/ent/vite-plugin-node/examples/nest
> nest start
src/main.ts:4:17 - error TS2339: Property 'env' does not exist on type 'ImportMeta'.
4 if (import.meta.env.PROD) {
~~~
vite.config.ts:2:32 - error TS2307: Cannot find module 'vite-plugin-node' or its corresponding type declarations.
2 import { VitePluginNode } from 'vite-plugin-node';
~~~~~~~~~~~~~~~~~~
Found 2 error(s).
ELIFECYCLE Command failed with exit code 1.
Some remarks:
pnpm start
;My guess is that I need to create a type definition for ImportMetaEnv manually: https://vitejs.dev/guide/env-and-mode.html#intellisense-for-typescript
I'll try this later.
Hello. Currently it's not possible to run the NestJS example with the current TS configuration. If trying to run
pnpm start
yields:And then, changing module to "es2020" and adding 'moduleResolution: "node"' in tsconfig.json:
Is it outdated or did I forget some configuration?