Skip to content

fix(js): stop generating baseUrl in tsconfig, use ./ prefix for path mappings#34965

Draft
leosvelperez wants to merge 1 commit intomasterfrom
misc/remove-base-url
Draft

fix(js): stop generating baseUrl in tsconfig, use ./ prefix for path mappings#34965
leosvelperez wants to merge 1 commit intomasterfrom
misc/remove-base-url

Conversation

@leosvelperez
Copy link
Member

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). baseUrl is deprecated in TS 6 and removed in TS 7.

Expected Behavior

Nx no longer generates baseUrl in any tsconfig. Path mappings use ./ prefix (e.g., ./my-lib/src/index.ts), making them relative to the tsconfig file without needing baseUrl. Existing user tsconfigs with baseUrl are not touched.

Changes:

  • Remove baseUrl from all templates and generator code
  • addTsConfigPath normalizes lookup paths with ./ prefix
  • Move and remove generators handle ./-prefixed paths correctly
  • Angular secondary entry points and Remix server entry paths use ./ prefix
  • E2e tests updated to match

@leosvelperez leosvelperez self-assigned this Mar 23, 2026
@netlify
Copy link

netlify bot commented Mar 23, 2026

Deploy Preview for nx-docs failed. Why did it fail? →

Name Link
🔨 Latest commit a211d4c
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69c2b205c9b0860008ae31d5

@netlify
Copy link

netlify bot commented Mar 23, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit a211d4c
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69c2b20562e1760008f7a5fa
😎 Deploy Preview https://deploy-preview-34965--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Mar 23, 2026

View your CI Pipeline Execution ↗ for commit a211d4c

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ❌ Failed 53m 49s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 8s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded 31s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx affected -t e2e-macos-local --parallel=1 --b... ✅ Succeeded 46m 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-24 18:11:49 UTC

@leosvelperez leosvelperez force-pushed the misc/remove-base-url branch 3 times, most recently from 5187080 to 4e18edf Compare March 24, 2026 15:33
nx-cloud[bot]

This comment was marked as outdated.

…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.
@leosvelperez leosvelperez force-pushed the misc/remove-base-url branch from 4e18edf to a211d4c Compare March 24, 2026 15:47
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant