Closed angelhdzdev closed 2 years ago
Before the error with the red text, I get the following error:
vite v2.9.8 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 295ms.
X [ERROR] Could not resolve "cache-manager"
node_modules/@nestjs/common/cache/cache.providers.js:16:116:
16 │ ...() => require('cache-manager'));
╵ ~~~~~~~~~~~~~~~
You can mark the path "cache-manager" as
external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
X [ERROR] Could not resolve "class-validator"
node_modules/@nestjs/common/pipes/validation.pipe.js:31:182:
31 │ ...=> require('class-validator')));
╵ ~~~~~~~~~~~~~~~~~
You can mark the path "class-validator" as
external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
X [ERROR] Could not resolve "@nestjs/microservices"
node_modules/@nestjs/core/nest-factory.js:52:128:
52 │ ...quire('@nestjs/microservices'));
╵ ~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path
"@nestjs/microservices" as external to
exclude it from the bundle, which will
remove this error. You can also surround
this "require" call with a try/catch block
to handle this failure at run-time instead
of bundle-time.
X [ERROR] Could not resolve "class-transformer"
node_modules/@nestjs/common/serializer/class-serializer.interceptor.js:22:252:
22 │ ...> require('class-transformer'));
╵ ~~~~~~~~~~~~~~~~~~~
You can mark the path "class-transformer" as
external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
X [ERROR] Could not resolve "class-transformer"
node_modules/@nestjs/common/pipes/validation.pipe.js:34:190:
34 │ ... require('class-transformer')));
╵ ~~~~~~~~~~~~~~~~~~~
You can mark the path "class-transformer" as
external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
X [ERROR] Could not resolve "@nestjs/websockets/socket-module"
node_modules/@nestjs/core/nest-application.js:18:115:
18 │ ...ire('@nestjs/websockets/socke...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path
"@nestjs/websockets/socket-module" as
external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
X [ERROR] Could not resolve "@nestjs/microservices/microservices-module"
node_modules/@nestjs/core/nest-application.js:19:132:
19 │ ...ire('@nestjs/microservices/mi...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path
"@nestjs/microservices/microservices-module"
as external to exclude it from the bundle,
which will remove this error. You can also
surround this "require" call with a
try/catch block to handle this failure at
run-time instead of bundle-time.
reflect-metadata doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
X [ERROR] Could not resolve "@nestjs/microservices"
node_modules/@nestjs/core/nest-application.js:117:128:
117 │ ...uire('@nestjs/microservices'));
╵ ~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path
"@nestjs/microservices" as external to
exclude it from the bundle, which will
remove this error. You can also surround
this "require" call with a try/catch block
to handle this failure at run-time instead
of bundle-time.
After running
npm run dev
which runsvite
, I'm receiving an error that doesn't affect compilation, but I would like to get rid of it.After the error, everything runs perfectly:
package.json:
tsconfig.json:
vite.config.ts:
Thanks.