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]: Using both react-router-dom and react-router-dom-v5-compat, and running into commonjs/esm related issues #12127

Closed
dhavaljardosh opened this issue Oct 14, 2024 · 1 comment
Labels

Comments

@dhavaljardosh
Copy link

What version of React Router are you using?

5.3.3

Steps to Reproduce

I have all these 3 versions in my package.json

"react-router": "5.3.4",
"react-router-dom": "5.3.4",
"react-router-dom-v5-compat": "6.23.1",

And planning to migrate in the future to v6 and that's the reason we have the compat version.

But we keep running into jest issue of test failing with a message saying that
You are loading the ES modules build of React Router on a page that is already running the CommonJS build, so things won't work right.

Expected Behavior

Jest tests should be running

Actual Behavior

Jest test failing with the below message:

Test suite failed to run

You are loading the ES modules build of React Router on a page that is already running the CommonJS build, so things won't work right.
@dhavaljardosh
Copy link
Author

turned out we had one import from react-router-dom which was causing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant