Repository navigation
Closed
Description
Steps taken:
- Create fresh nestjs application
- Add @swc/core to dev dependencies
- Create vite.config.ts
- Update src/main.ts
When removing the tsCompiler option I get the same error, but I was under the impression swc would fix 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.
package.json:
{
"name": "api",
"version": "1.0.0",
"private": true,
"license": "MIT",
"scripts": {
"prebuild": "rimraf dist",
"build": "vite build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"dev": "vite",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "vitest",
"test:watch": "vitest --watch",
"test:cov": "vitest --coverage"
},
"dependencies": {
"@nestjs/common": "^8.0.0",
"@nestjs/core": "^8.0.0",
"@nestjs/platform-express": "^8.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
},
"devDependencies": {
"@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.0",
"@swc/core": "^1.2.187",
"@types/express": "^4.17.13",
"@types/node": "^16.0.0",
"@types/supertest": "^2.0.11",
"config": "workspace:*",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig": "workspace:*",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5",
"vite": "^2.9.9",
"vite-plugin-node": "^0.0.19"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "vitest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}Metadata
Metadata
Assignees
Labels
No labels



Activity
EdwardKerckhof commentedon May 20, 2022
Does not give breaking issues.
sebastiangug commentedon Jul 1, 2022
@EdwardKerckhof what was the solution for this? currently facing the same problem.
Simolation commentedon Mar 24, 2023
I have the same issue. How did you resolve it?
SymphonyIceAttack commentedon Apr 2, 2023
I have sent a PR for this issue which can loging the message about which file update
feat: SwcFileChangeToLogMessage vite-plugin-node axe-me#46
chore: SwcFileChange vite-plugin-node axe-me#46