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

[Bug]: "Cannot find module './index' or its corresponding type declarations" in react-router-dom/server.d.ts #11509

Closed
neoGeneva opened this issue Apr 29, 2024 · 5 comments · Fixed by #11514 or electrode-io/electrode#2011
Labels

Comments

@neoGeneva
Copy link

What version of React Router are you using?

6.23.0

Steps to Reproduce

Install react-router-dom in a TS project, and attempt to compile the project.

Expected Behavior

The project compiles.

Actual Behavior

An error is raised during compilation:

node_modules/react-router-dom/server.d.ts:3:58 - error TS2307: Cannot find module './index' or its corresponding type declarations.

3 import type { FutureConfig, Location, RouteObject } from "./index";
                                                           ~~~~~~~~~
@neoGeneva neoGeneva added the bug label Apr 29, 2024
@faergeek
Copy link
Contributor

In a previous version this import looked like this:

import type { FutureConfig, Location, RouteObject } from "react-router-dom";

And there are no recent changes in source here. So I guess something has changed in a build process maybe?

@timdorr
Copy link
Member

timdorr commented Apr 29, 2024

Broken by #11358

Also of note, @markdalgleish pointed out we needed to make this change here: #11358 (comment)

A temporary workaround may be to import/require from react-router-dom/dist/server, but I'm not 100% sure.

@brophdawg11
Copy link
Contributor

This is resolved by #11514 and will be available in the next release

Copy link
Contributor

🤖 Hello there,

We just published version 6.23.1-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 6.23.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 removed the awaiting release This issue have been fixed and will be released soon label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants