You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An import spelled with a trailing slash or a ./ segment loses its lazy-component and file-import edges #2577
A JS/TS import whose specifier ends in a slash, like import('@/widgets/Chart/'), or carries a . segment, like src/widgets/./Chart, loses the edges the plain spelling gets. The lazy-loaded component is no longer linked, and App gets a calls edge to its own Chart const instead. A named import from the same specifier still resolves.
Reproduction (verified)
On main at c71a3d0, built from source, Linux (WSL2), Node 22.22.2. The project has two files, plus a package.json with react:
// src/App.tsx (SPEC is one of the three spellings below)import{lazy}from'react';import{Legend}from'SPEC';constChart=lazy(()=>import('SPEC'));exportfunctionApp(){Legend();return<Chart/>;}
App -calls-> src/widgets/Chart/index.tsx::Legend and App.tsx -imports-> …::Legend are present in all three rows.
Likely cause (inferred from reading the code)
fileExists falls back to fs.existsSync, which accepts src/widgets/Chart//index.tsx and src/widgets/./Chart/index.tsx. The import resolver's alias and bare-path branches (for example resolveAliasedImport) join the specifier as written and return that spelling. Lookups keyed by the indexed path, such as getNodesInFile or a files row, then miss. Normalizing the path once, at resolveImportPath's return or in fileExists, would fix every caller.
Such a path also reaches synthesis_inputs, whose file_path references files(path) (#2565). #2574 normalizes on that one write, but the resolver still returns the raw spelling.
Windows, macOS (case-insensitive paths), and tsconfig paths aliases. The @/ above goes through the fallback alias, with no tsconfig in the project. From reading the code, the relative and tsconfig-paths branches normalize, but I have not tested that.
Thanks for the precise report and for tracing it to the resolver's path handling.
#2792 is merged to main. An import spelled with a trailing slash, a ./ or ../ segment, or a doubled slash now links like the plain spelling:
the file import comes back;
its names resolve through the import;
a lazily loaded component points at the component the file exports.
That holds for the @/ fallback, direct src/… paths and workspace packages. A trailing slash still names a folder, so @/widgets/Chart/ resolves to Chart/index.tsx, as Node and tsc read it. The fix ships in the next release.
Activity
fix(resolution): an import spelled with a trailing slash or a ./ segm…
Merge upstream/main into fork main (weekly sync 2026-10-21)
Merge colbymchenry#2610 (import spellings resolve to the indexed path, …
colbymchenry commentedon Oct 22, 2026
Thanks for the precise report and for tracing it to the resolver's path handling.
#2792 is merged to
main. An import spelled with a trailing slash, a./or../segment, or a doubled slash now links like the plain spelling:That holds for the
@/fallback, directsrc/…paths and workspace packages. A trailing slash still names a folder, so@/widgets/Chart/resolves toChart/index.tsx, as Node and tsc read it. The fix ships in the next release.fix(js,ts): an import spelled with a trailing slash or a ./ segment l…
fix(rust): workspace package entries, path dependencies and import sp…