We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
baseUrl
swc
No response
9.5.0 -> 10.0.5
When I run npm run start (nest start) in my project with NestJs 10 and swc enabled, an error is thrown:
npm run start
nest start
> test-nestjs@0.0.1 start > nest start ✔ TSC Initializing type checker... > TSC Found 0 issues. > SWC Running... Successfully compiled: 5 files with swc (26.57ms) Error: Cannot find module 'app.module' Require stack: - /home/kirian/Projects/Perso/test-nestjs/dist/main.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15) at Function.Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object.<anonymous> (/home/kirian/Projects/Perso/test-nestjs/dist/main.js:6:20) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Function.Module._load (node:internal/modules/cjs/loader:878:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
It seems that the baseUrl option from my tsconfig.json and .swcrc is not recognized when using non-relative import.
tsconfig.json
.swcrc
https://github.com/KirianCaumes/nestjs-bug-swc-import
// src/main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from 'app.module'; // 👈 async function bootstrap() { const app = await NestFactory.create(AppModule); await app.listen(5002); } bootstrap();
// nest-cli.json { "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { "builder": "swc", "typeCheck": true } }
// .swcrc { "$schema": "https://json.schemastore.org/swcrc", "sourceMaps": true, "jsc": { "parser": { "syntax": "typescript", "decorators": true, "dynamicImport": true }, "baseUrl": "./src" }, "minify": false }
// tsconfig.json { "compilerOptions": { "module": "commonjs", "declaration": true, "removeComments": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "target": "es2017", "sourceMap": true, "outDir": "./dist", "baseUrl": "./src", "incremental": true, "skipLibCheck": true, "strictNullChecks": false, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false } }
It should work the same way as without swc enabled and with baseUrl being used.
The text was updated successfully, but these errors were encountered:
Please, report this issue in the swc https://github.com/swc-project/swc repository
Sorry, something went wrong.
No branches or pull requests
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
No response
NestJS version
9.5.0 -> 10.0.5
Describe the regression
When I run
npm run start
(nest start
) in my project with NestJs 10 andswc
enabled, an error is thrown:It seems that the
baseUrl
option from mytsconfig.json
and.swcrc
is not recognized when using non-relative import.Minimum reproduction code
https://github.com/KirianCaumes/nestjs-bug-swc-import
Input code
Expected behavior
It should work the same way as without
swc
enabled and withbaseUrl
being used.Other
No response
The text was updated successfully, but these errors were encountered: