'Nuxt3 deployment on vercel error 404 not found

i am trying to deploy nuxt3 app to vercel .

I get the build success as well.

But once deployment is done getting 404 error page.

nuxt.config.ts

export default defineNuxtConfig({
ssr: false,
target: 'static',
})

package.json

scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs",
"generate": "nuxt generate"
}

Build and deployment settings kept as it is.

Thanks! Any help would be appreciated.

Attached image for the reference.



Solution 1:[1]

EDIT

The error was coming from a mistakenly imported package import anytime from 'anytime', removing it solved the issue.


You can run npx serve .output/public after yarn generate to see if it's working locally before trying to deploy anywhere.

Then for Vercel, you can either set the default value or use those.

enter image description here

Here is a working Github repo. Everything should be quite straightforward.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1