-
Notifications
You must be signed in to change notification settings - Fork 2.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
remix dev is unusable if you have packages like framer-motion, react-three-fiber, etc. #3337
Comments
After further testing, it seems that only @react-three/fiber and @react-three/drei seem to have issues. framer-motion seems to work just fine actually, but the second you add a fiber or drei import (even on another route) it breaks, my example has both imports at the same time so I wrongfully assumed it's also framer-motion that doesn't work. However, I'd still like to resolve the import issues with these 3d libraries as remix and fiber are a perfect pair. I'm not sure where to start and what the issue exactly is but it seems bundling is the culprit. there are a few options of where this issue could be coming from:
related issues |
Tested even further and it seems like just react-three/drei might be the issue, not 100% sure but what's weird is that dev builds don't work and production builds work without issues. |
It does appear to be an issue with |
I'm actually going to close this because I think the larger issue is captured in #2987. I'm going to dig in on the compiler and we'll track this bug there instead. |
What version of Remix are you using?
1.5.1
UPDATE:
Might be just the @react-three/drei dependency that's causing issues.
Steps to Reproduce
Digging into console: Uncaught SyntaxError: Identifier 'React' has already been declared
Expected Behavior
remix dev works just like remix build && remix start
Actual Behavior
Throws: Cannot initialize 'routeModules'. This normally occurs when you have server code in your client modules.
Digging into console: Uncaught SyntaxError: Identifier 'React' has already been declared.
Basically, you can't use external libraries like react-three-fiber or framer-motion at all, neither with react 18 nor with react 17, effectively rendering remix dev unusable.
The text was updated successfully, but these errors were encountered: