<- Back
Prerequisite
- Make sure that Nodejs Version is 16.8 or higher.
- npm i [email protected] --legacy-peer-deps
what changes you need to make
- Link component imported from next/link You will get below error for Link component, when you install latest next package.
Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.12.1.6
To fix this, you do not need to manually change codebase. You can use below command to fix the issue
npx @next/codemod@latest new-link ./components
npx @next/codemod@latest new-link ./pages
- Image component imported from next/image - Image with src "/xyz.png" has invalid "width" property. Expected a numeric value in pixels but received "30px"
To fix this error, you can use below code.
npx @next/codemod@latest next-image-to-legacy-image ./pages
Web development and Automation testing
solutions delivered!!