Hello Fellow StackOverflow community,
I'm a newbie in Next.js 13 development and I've just finished my Next.js 13 app with TypeScript and TailwindCSS. Locally it worked fine, but when trying to deploy to Vercel, with the selected Next.js deployment preset, Vercel is stuck in build stage after 6s with Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
. When I check the dependencies, next is correctly set to latest
. I've tried to change latest
to the actual numerical version, but nothing changed. I have no idea what to do at this point as I didn't even find any post/article concerning this specific problem. You can review the package.json
file and Vercel build log down below.
package.json
file:
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@next/font": "^13.0.3",
"encoding": "^0.1.13",
"ioredis": "^5.2.4",
"next": "latest", //<-- Here you can see the demanded next version.
"next-auth": "^4.17.0",
"pusher": "^5.1.1-beta",
"pusher-js": "^7.5.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-timeago": "^7.1.0",
"swr": "^1.3.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "18.11.3",
"@types/react": "18.0.21",
"@types/react-dom": "18.0.6",
"@types/react-timeago": "^4.1.3",
"@types/uuid": "^8.3.4",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.1",
"typescript": "4.8.4"
}
}
build log from Vercel:
[09:32:02.407] Cloning github.com/AnorakDWise/chat-app (Branch: master, Commit: 5b3bd6d)
[09:32:02.412] The cli flag --force was set. Skipping build cache download.
[09:32:03.153] Cloning completed: 745.348ms
[09:32:03.534] Running "vercel build"
[09:32:03.988] Vercel CLI 28.5.5
[09:32:04.255] Your application is being built using `next build`. If you need to define a different build step, please create a `vercel-build` script in your `package.json` (e.g. `{ "scripts": { "vercel-build": "npm run prepare && next build" } }`).
[09:32:04.256] Installing dependencies...
[09:32:04.574] yarn install v1.22.17
[09:32:04.584] warning package.json: No license field
[09:32:04.589] info No lockfile found.
[09:32:04.592] warning No license field
[09:32:04.593] [1/4] Resolving packages...
[09:32:04.593] [2/4] Fetching packages...
[09:32:04.594] [3/4] Linking dependencies...
[09:32:04.598] [4/4] Building fresh packages...
[09:32:04.600] success Saved lockfile.
[09:32:04.602] Done in 0.03s.
[09:32:04.670] Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
I'd really appreciate any kind of help, Thank You.
I've solved the issue by hosting the app on a development server, skipping the whole process of building the app to production. Thanks for everyone's support and efforts! <3