React DOM seems to be imported twice
Answered
Spinge Bib Sqorpnts posted this in #help-forum
Hello! I am trying to reduce my bundle size, and when I went to check with
@next/bundle-analyzer
it seems as if ReactDOM is imported twice.analyze/client.html
shows:Answered by Spinge Bib Sqorpnts
Seems that you were right: https://github.com/vercel/next.js/issues/56400
11 Replies
For context, I'm using PNPM instead of NPM.
I tried reinstalling all packages with PNPM, now retrying with NPM.
I tried reinstalling all packages with PNPM, now retrying with NPM.
using npm over pnpm did not resolve the issue
It could be different parts of the package, but I don't know much about the internals
Spectacled Eider
Maybe it's the two versions of react-dom , one for the app folder and other for the pages folder
wdym? I'm using the App router, no single reference to the old Pages router
Spectacled Eider
For me when I used the pages folder together with the app folder it appeared two versions but that doesn't seen's to be the your case
any idea what it could be?
Asian black bear
It is intentional as one is for the client bundle and one for the server bundle.
Then why are both included on the
client.html
analysis file?Seems that you were right: https://github.com/vercel/next.js/issues/56400
Answer
Spectacled Eider
That happened to me before when I was changing to the app folder