nx
nx copied to clipboard
fix(vite): resolves files with dot suffixes correctly
Use basename for retrieving the filename in findFile function from nx-tsconfig-paths.plugin that previously led to an unresolved error for files with dot suffixes e.g./dir/file.suffix.ext
Current Behavior
For files that have the same name but one of them has a suffix, e.g.
- lib1
- file.ts
- file.i18n.ts
- apps
- app1
- main.ts
- tsconfig.base.json // with { "paths": { "@lib1/*": ["lib1/*"] }}
The resolving process is incorrect because the import value from '@lib1/file.i18n' from apps/app1/main.ts every time resolves to file.ts, and the parse method from the node:path splits away the suffix from the name.
Expected Behavior
import value from '@lib1/file.i18n' should work correctly if you import them from another package
Related Issue(s)
Fixes #27852
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| nx-dev | ⬜️ Ignored (Inspect) | Visit Preview | Dec 12, 2024 5:15pm |
Your CI Pipeline Execution ↗ for commit 1cbeed56c2e854ecd62369b5d7e687c686f85cbd ✅ succeeded.
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=lint,test,build,e2e,e2e-c... |
✅ Succeeded | 57s | View ↗ |
nx run-many -t check-imports check-commit check... |
✅ Succeeded | 21s | View ↗ |
nx-cloud record -- nx-cloud conformance:check |
✅ Succeeded | 0s | View ↗ |
nx-cloud record -- nx format:check --base=a0f42... |
✅ Succeeded | 1s | View ↗ |
nx-cloud record -- nx sync:check |
✅ Succeeded | 0s | View ↗ |
nx documentation --no-dte |
✅ Succeeded | 0s | View ↗ |
Last updated at 2024-12-12 20:07:08UTC
Sent with 💌 from NxCloud.
There is some regression. I'm fixing...
I'm not sure 100%, but I think there was a mistake here when creating the file foo.mts and later importing the file foo.mjs.
Hello, nx team. Could you provide some feedback about this PR, we really need this fix in our project. I will appreciate this
same here, need this regression fixed 👍
Same here! Wondering if this fix will land in the next release :)
Sorry to bug again but this issue is still preventing us from being able to upgrade Nx!
yep, we are on 20.2.2, and this is been a regression since 19.6.6+
@KonstantinKai @roshcagra @dvictory This has been merged now and should release in a patch soon
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.