Nextjs build bundle includes react-dom twice
Asked Answered
B

0

12

I set up webpack analyzer to take a look at my bundle size and I've noticed that react-dom is included twice. Does anyone know why that is and how to fix it? enter image description here

also here is my package.json:

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "analyze": "cross-env ANALYZE=true next build"
  },
  "dependencies": {
    "framer-motion": "^10.12.16",
    "next": "^13.4.6",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@next/bundle-analyzer": "^13.4.6",
    "autoprefixer": "^10.4.14",
    "cross-env": "^7.0.3",
    "postcss": "^8.4.24",
    "tailwindcss": "^3.3.2"
  }
}
Bonney answered 16/6, 2023 at 18:12 Comment(2)
Can't really answer your question but just ran into the same phenomenon and have opened an issue on GitHub.Lablab
Please see this: github.com/vercel/next.js/issues/56063#issuecomment-1737229090Kaete

© 2022 - 2025 — McMap. All rights reserved.