-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Client-side JS fails to execute when using pnpm and importing react-dom on a page #20884
Comments
Apply workaround for vercel/next.js#20884
I've discovered that the problem isn't specifically with react-modal, but with react-dom in general. The problem manifests when importing react-modal since the react-modal package imports react-dom. I've simplified the repro at nextjs-pnpm-issue-2021-01-07 accordingly. |
I'm working on a fix over at #21048. In the meantime, this is a workaround: // next.config.js
module.exports = {
webpack: (config) => {
// Workaround for https://github.com/vercel/next.js/issues/20884
config.optimization.splitChunks = false;
return config;
},
}; |
To be clear disabling splitChunks is not an option if you are planning to deploy to production. |
Adding |
This issue is still a problem for pnpm users. I would appreciate if a maintainer could comment on #21048 when you have time. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.6-canary.0
What version of Node.js are you using?
14.15.3
What browser are you using?
Edge (Chromium)
What operating system are you using?
macOS
How are you deploying your application?
next start
Describe the Bug
Client-side JS fails to execute in a specific scenario:
about.js
) but not in another page (index.js
).Expected Behavior
Client-side JS should execute when visiting the index page.
To Reproduce
Full repro: https://github.com/elliottsj/nextjs-pnpm-issue-2021-01-07
The text was updated successfully, but these errors were encountered: