Upgrading from next 14 to 15
Unanswered
West African Lion posted this in #help-forum
West African LionOP
Which should I pick? I'm upgrading my next to v15 by running this command
npx @next/codemod@canary upgrade latest
9 Replies
canary versions have experimental or new features, if you don't want to test any specific one, you can try this to go to next 15 stable version
npx @next/codemod@latest upgrade latest
npx @next/codemod@latest upgrade latest
npx @next/codemod@latest upgrade latest
Detected installed versions:
- React: v18.3.1
- Next.js: v14.2.3
√ Enable Turbopack for next dev? ... yes
? The following codemods are recommended for your upgrade. Select the ones to apply. »
Instructions:
↑/↓: Highlight option
←/→/[space]: Toggle selection
a: Toggle all
enter/return: Complete answer
(*) (v15.0.0-canary.179) app-dir-runtime-config-experimental-edge
Transform App Router Route Segment Config `runtime` value from `experimental-edge`
to `edge`
(*) (v15.0.0-canary.171) next-async-request-api
(*) (v15.0.0-canary.153) next-request-geo-ip
you can choose the last one and if you don't like it you can always manually change the package.json to next 15 and react 19 after
West African LionOP
Got new errors
Upgrading your project to Next.js 15.1.7...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: event-ms@0.1.0
npm error Found: date-fns@4.1.0
npm error node_modules/date-fns
npm error date-fns@"^4.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer date-fns@"^2.28.0 || ^3.0.0" from react-day-picker@8.10.1
npm error node_modules/react-day-picker
npm error react-day-picker@"8.10.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
delete node_modules, delete package-LOCK.json and npm install --legacy-peer-deps
@chisto delete node_modules, delete package-LOCK.json and npm install --legacy-peer-deps
West African LionOP
Why there are some missing modules like this
Cannot find module 'next/navigation' or its corresponding type declarations
after running npm install --legacy-peer-deps
?try reloading vscode, sometimes it bugs and show missing modules when you uninstall and re install, its just a visual red error but everything runs fine
@chisto try reloading vscode, sometimes it bugs and show missing modules when you uninstall and re install, its just a visual red error but everything runs fine
West African LionOP
Tyvm, the code is working fine