-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Can't use react-dnd ESM library: ERR_REQUIRE_ESM #3023
Comments
Did you wipe the lockfile and |
I tried these imports in a fresh minimal template (not the Blues stack) and they worked. I doubt they fail in the Blues stack either, try to figure out what is special about your setup, see if you can reproduce it in a fresh build. |
It didn't work for me with the regex, but the exhaustive list seems to work: module.exports = {
cacheDirectory: "./node_modules/.cache/remix",
ignoredRouteFiles: [".*", "**/*.css", "**/*.test.{js,jsx,ts,tsx}"],
serverDependenciesToBundle: [
"react-dnd",
"react-dnd-html5-backend",
"react-dnd-touch-backend",
"@react-dnd/invariant",
"dnd-core",
"@react-dnd/shallowequal",
"@react-dnd/asap",
],
}; |
I added a command to my npx rmx get-esm-packages react-dnd react-dnd-html5-backend react-dnd-touch-backend {
'react-dnd',
'@react-dnd/invariant',
'@react-dnd/shallowequal',
'dnd-core',
'@react-dnd/asap',
'react-dnd-html5-backend',
'react-dnd-touch-backend'
} |
You can find the latest version here https://github.com/kiliman/rmx-cli |
What version of Remix are you using?
1.4.1 – Blues stack
Steps to Reproduce
Expected Behavior
No errors
Actual Behavior
I recently migrated my remix project to the blues stack (1.4.1). I'm using react-dnd in my project. When I executed
npm run dev
, I got the following warnings + error:I followed the warnings advice, adding stuff to
serverDependenciesToBundle
. Several iterations led me to end up with this remix.conf.js file:But I still get an error:
In my old project setup (
"remix": "^1.2.3"
), it was working flawlessly.Existing issues has been closed an redirected to #109 but has been closed too:
#109 (comment)
But in this case,
serverDependenciesToBundle
doesn't seem to help.Any help would be greatly appreciated 🙏
The text was updated successfully, but these errors were encountered: