I have created Next.js app by the command npx create-next-app@latest after running it npm run dev, I am getting below error.
Uncaught TypeError: URL.canParse is not a function at getSocketUrl (webpack-internal:///(:3001/app-pages-browser)/./node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/get-socket-url.js:23:13)
The app is created with Next.js version 14.2.11
I have tried to fix it by following suggestions provided by ChatGpt with no success. Tried below solutions
npm update next react react-dom
Clear Cache - rm -rf .next
Restart server - npm run dev
Downgrading nextjs version to 14.2.10 works.
A similiar issue suggest checking/updating your node-version as well as upgrading @types/node. This might work for you, too.
According to Node.js URL.canParse was added in: v19.9.0, v18.17.0.
You can run node -v in your terminal to check your current Node version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With