-
Notifications
You must be signed in to change notification settings - Fork 771
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
Nextjs v11 with webpack5 doesn't work in dev mode #224
Comments
I experienced the same issue. But this is related to the newest versions of Next.js which defaults to Webpack 5. It will work if you revert to Webpack 4: module.exports = {
future: {
webpack5: false,
},
}; |
The problem is repeated at random whenever I'm installing a new package and I'm force to override the node modules folder with a working copy every time this happens, does anyone have a fix? changing the next.config.js did not work for me. |
is anyone working on making the chart compatible with webpack 5? |
It looks like this is a bug with Next.js/Webpack and resolving ESM files. I have created a minimal reproduction here https://github.com/edew/nextjs-webpack-module-bug. Until this is fixed in Next.js you can try one of these workarounds:
|
I tried this, it works when I revert the webpack to v4, but I have another module that only works when I use the webpack 5. So I tried another workaround, but after I deleted the *PS: I use NextJS 10 |
Any update on this issue? Nextjs 12 doesn't support going back to webpack 4 anymore. |
@icy-meteor why are you asking to provide a fix here? For me it looks like an issue of next.js as we found out in #224 (comment). Maybe you would like to create an issue in nextjs repo and fix it there? Alternatively you still have the second option, have you tried it? |
Hey, thanks for the reply. Appreciate it :) |
@timocov this is still an issue with both solutions given and Next.js 12, which is unfortunately not allowing us to make use of this library despite paying. Are you unable to distribute this in a normal fashion via NPM? |
Unfortunately we're unable to publish charting library as a npm package so far. We'll try to fix the issue caused by esm and will go back as far as we get anything. |
has anyone tried using dynamic imports?
|
It seems the issue has been fixed by nextjs team and now it works with the latest nextjs version. Please check it out and say if it doesn't work for you. |
@timocov I am still having the same issue I use nextjs |
@tukuyoma It is not supposed to work with v11. The minimal nextjs version that works is 12.1.0. |
@timocov thanks it worked |
Upgrade nextjs to v 12.1 fix the issue for me as well! Thanks a lot, I spent 3 days to figure it out! |
I followed this tutorial: https://github.com/tradingview/charting-library-examples/tree/master/nextjs-javascript
When using
npm run build
andnpm run start
it works without problems. However, when usingnpm run dev
tradingview isn't showing.The text was updated successfully, but these errors were encountered: