Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The library is not compatible with "NodeNext" ts module resolution #1128

Closed
vovkiv94 opened this issue Feb 1, 2024 · 2 comments
Closed

The library is not compatible with "NodeNext" ts module resolution #1128

vovkiv94 opened this issue Feb 1, 2024 · 2 comments

Comments

@vovkiv94
Copy link

vovkiv94 commented Feb 1, 2024

Describe the bug

I have a package that uses "NodeNext" ts moduleResolution.
When i try to add '@tanstack/react-router' imports like import { createRootRoute } from '@tanstack/react-router'; tsc is complaining that error TS2305: Module '"@tanstack/react-router"' has no exported member 'createRootRoute'.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue

  1. Create a new ts project and set ts module resolution to NodeNext
  2. Install @tanstack/react-router
  3. Import anything from the @tanstack/react-router library
  4. Run tsc

Expected behavior

The library should be compatible with NodeNext moduleResolution.

Screenshots or Videos

No response

Platform

all

Additional context

The issue is happening because the library ships index.d.ts file without .js extensions in imports which is required by NodeNext.
More details: microsoft/TypeScript#50482

@schiller-manuel
Copy link
Contributor

which version did you test this with? please provide a minimal example on e.g. codesandbox.

current versions of router have the correct exports:

Screenshot 2024-02-01 at 20 43 12

@vovkiv94
Copy link
Author

vovkiv94 commented Feb 1, 2024

Seems like I need to bump the version to 1.12.16+ where it was added. Thanks

@vovkiv94 vovkiv94 closed this as completed Feb 1, 2024
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

No branches or pull requests

2 participants