fix(js): stop generating baseUrl in tsconfig, use ./ prefix for path mappings#34965
fix(js): stop generating baseUrl in tsconfig, use ./ prefix for path mappings#34965leosvelperez wants to merge 1 commit intomasterfrom
Conversation
❌ Deploy Preview for nx-docs failed. Why did it fail? →
|
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit a211d4c
☁️ Nx Cloud last updated this comment at |
5187080 to
4e18edf
Compare
…mappings baseUrl is deprecated in TS 6 and removed in TS 7. Path mappings now use ./ prefix (e.g., ./my-lib/src/index.ts) which makes them relative to the tsconfig file without needing baseUrl.
4e18edf to
a211d4c
Compare
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We were unable to link this failure to the PR's changes. The error (Cannot find module './nx-deps-cache') originates from a missing compiled artifact inside the nx package dist output, which is unrelated to the tsconfig baseUrl and path mapping changes introduced here. Our recommendation is to re-trigger the pipeline to allow the build environment to recover.
No code changes were suggested for this issue.
Trigger a rerun:
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
Current Behavior
Nx generators set
compilerOptions.baseUrl: "."in generated tsconfig files and write path mappings as bare relative paths (e.g.,my-lib/src/index.ts).baseUrlis deprecated in TS 6 and removed in TS 7.Expected Behavior
Nx no longer generates
baseUrlin any tsconfig. Path mappings use./prefix (e.g.,./my-lib/src/index.ts), making them relative to the tsconfig file without needingbaseUrl. Existing user tsconfigs withbaseUrlare not touched.Changes:
baseUrlfrom all templates and generator codeaddTsConfigPathnormalizes lookup paths with./prefix./-prefixed paths correctly./prefix