Regression: generated d.ts files for ESM don’t have file extensions #2190
Send to my agentDescribe the bug#
The bug reported in #1087 appears again with the latest version 1.50.1 for @tanstack/react-router as well as @tanstack/start
react-router:
node_modules/@tanstack/react-router/dist/esm/fileRoute.d.ts:54:31 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './useNavigate.js'?
54 useNavigate: () => import('./useNavigate').UseNavigateResult<string>;
~~~~~~~~~~~~~~~
node_modules/@tanstack/react-router/dist/esm/index.d.ts:58:118 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './utils.js'?
58 pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, useStableCallback, shallow, } from './utils';
~~~~~~~~~
node_modules/@tanstack/react-router/dist/esm/link.d.ts:1:43 - error TS2307: Cannot find module '.' or its corresponding type declarations.
1 import { AnyRouter, ParsedLocation } from '.';
start:
node_modules/@tanstack/start/dist/esm/client/index.d.ts:8:70 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '../constants.js'?
8 export { serverFnPayloadTypeHeader, serverFnReturnTypeHeader, } from '../constants';
Your Example Website or App#
https://stackblitz.com/edit/github-yk78pg-anfycf?file=README.md
Steps to Reproduce the Bug or Issue#
- set
moduleResolutionintsconfigset tonode16 - import something from
@tanstack/react-routeror@tanstack/start - run the typescript compiler
Expected behavior#
I would expect the file extensions in the .d.ts file to be present.
Screenshots or Videos#
No response
Platform#
- OS: macos
- Version:
1.50.1
Additional context#
No response
schiller-manuel(GitHub profile, opens in a new tab) assignedschiller-manuel
SeanCassiere added labelsbug
sorry this issue got autoclosed when merging the PR but no release was triggered. now that 1.51.4 is released, those imports are fixed, see also https://arethetypeswrong.github.io/?p=%40tanstack%2Freact-router%401.51.4
Thanks for the fast reaction. I’ve tried
1.51.4now and can confirm the issues in@tanstack/react-routerare resolved, however there is still one issue in@tanstack/startleft:node_modules/@tanstack/start/dist/esm/client/index.d.ts:8:70 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '../constants.js'? 8 export { serverFnPayloadTypeHeader, serverFnReturnTypeHeader, } from '../constants'; ~~~~~~~~~~~~~~ Found 1 error in node_modules/@tanstack/start/dist/esm/client/index.d.ts:8See also https://arethetypeswrong.github.io/?p=%40tanstack%2Fstart%401.51.4
please create a new issue so this is properly tracked
Sign in to join this conversation.
🤔 I’ve just tried the latest version
start:1.51.3andreact-router:1.51.2and I still get those errors:See also: https://stackblitz.com/edit/github-yk78pg-sd8raq?file=src%2Fmain.tsx