Module not found: Can't resolve 'prop-types' when upgrading to 3.0.2
#3844
Replies: 4 comments
-
|
Same here. |
Beta Was this translation helpful? Give feedback.
-
|
I noticed similar issues but with other packages like (First I thought it was related to the CloudFlare outage today but the issue was still there after this was resolved) This is what worked for me (AI generated): 🚀 Umami Build Fix Summary (Shareable)Problem: Umami 3.0.2 + Next.js 15.5.7 + ✅ Complete Fix Steps1. Fix Package Manager Chaosrm -rf node_modules yarn.lock bun.lockb package-lock.json .next .yarn pnpm-lock.yaml
echo "legacy-peer-deps=true" > .npmrc
npm install --legacy-peer-deps
npm install topojson-client d3-geo prop-types --legacy-peer-deps2. Fix WorldMap SSR (Critical)File: Add 'use client';
import dynamic from 'next/dynamic';
const ComposableMap = dynamic(() => import('react-simple-maps').then(mod => mod.ComposableMap), { ssr: false });
const Geographies = dynamic(() => import('react-simple-maps').then(mod => mod.Geographies), { ssr: false });
const Geography = dynamic(() => import('react-simple-maps').then(mod => mod.Geography), { ssr: false });
const ZoomableGroup = dynamic(() => import('react-simple-maps').then(mod => mod.ZoomableGroup), { ssr: false });
// Replace all static imports with these3. Update package.json ScriptsRemove "build-app": "next build"
"dev": "next dev -p 3001"4. Final next.config.ts (Turbopack Fixed)webpack: (config, { isServer }) => {
if (isServer) {
// CRITICAL: Exclude browser-only map libs from SSR
const aliases = {
...config.resolve.alias,
'react-simple-maps': false,
'topojson-client': false,
'd3-geo': false,
'prop-types': false,
};
config.resolve.alias = aliases;
config.externals = config.externals || [];
config.externals.push(/react-simple-maps/, /topojson-client/, /d3-geo/, /prop-types/);
}
return config;
},5. Buildrm -rf .next node_modules/.cache
npm run build🎯 Expected Success🔧 Root Causes Fixed
💡Pro Tip
|
Beta Was this translation helpful? Give feedback.
-
|
Had the same experience, but if you follow the instructions and use |
Beta Was this translation helpful? Give feedback.
-
Argh, I was still using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
When upgrading umami from version 3.0.1 to 3.0.2, the upgrade process fails during the
yarn buildstep, complaining about theprop-typesmodule not being installed, althoughyarn installhas been run prior to the build command.Manually installing the
prop-typesmodule usingyarn add prop-typesfixes this issue and allowed me to finish the build process.Database
PostgreSQL
Relevant log output
Which Umami version are you using? (if relevant)
3.0.2 (from the v3.0.2 tag)
Which browser are you using? (if relevant)
N/A
How are you deploying your application? (if relevant)
Debian 13 + Node v20.19.2
Beta Was this translation helpful? Give feedback.
All reactions