-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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][v6]: StaticRouter can't import as documented #8353
Comments
The file definitely exists, but your tooling is pulling in the mjs version instead of the js version. The history library it's importing from doesn't have those as exports because they are just types. I'll see if we can fix this on our end. In the meantime, you might try switching to importing from |
Found a fix for you: formatjs/formatjs#1395 (comment) I double-checked and we do actually export Action, as it's an enum and has real value in non-TS code. The problem here is really more on the build tooling side. We can see about exporting mjs files in history, but there's nothing we've done strictly "wrong" here. |
That's the same issue I had on: #8221 |
Importing from I just checked again by dropping the |
background: remix-run/react-router#8353 (comment) `.js` extension seems to be no longer needed This also has the added benefit of reducing the bundle size by about 1.65kB
Thanks, This fixed it for me |
What version of React Router are you using?
6.0.2
Steps to Reproduce
Expected Behavior
StaticRouter should import without error, as documented here: https://reactrouter.com/docs/en/v6/upgrading/v5#get-staticrouter-from-react-router-domserver
Actual Behavior
Error:
The text was updated successfully, but these errors were encountered: