I deployed my Node.js express application, status of deployment = Ready, unfortunately it returned: 404: NOT_FOUND Code: NOT_FOUND ID: gru1:gru1::zph5r-1730229227559-5f387b64f0d3
Thanks for sharing the repo! It looks like the “check the deployment output” section of the 404 debugging post has the answer.
If the project uses a traditionally server-side framework, such as Express , you should make sure to put the index.js file in a /api directory so it will be deployed as a serverless function. In that case the path to the first page of your site would look like my-website.com/api which can be altered to use the root path / using rewrites .
You can find more info and a complete example project in this guide
Something like this would probably work better for your project given the structure it had when I looked earlier. But with { "rewrites": [{ "source": "/(.*)", "destination": "/api" }] } as the vercel.json instead of the builds configuration used in the article.
It worked! Now I have another problem. Trying to connect database created in Neon.Tech
I created a new variable in vercel ALSO I integrated NEON with Vercel.
DATABASE_URL: postgresql://believe_project_owner:7bsei2mwEcqk@ep-crimson-firefly-a57056qt.us-east-2.aws.neon.tech/believe_project?sslmode=require
Configurate database within my project. But it returned error:
Error: Please install pg package manually
at ConnectionManager._loadDialectModule (/var/task/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:55:15)
at new ConnectionManager (/var/task/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:15:24)
at new PostgresDialect (/var/task/node_modules/sequelize/lib/dialects/postgres/index.js:13:30)
at new Sequelize (/var/task/node_modules/sequelize/lib/sequelize.js:194:20)
at Object.<anonymous> (/var/task/models/index.js:16:15)
at Module.<anonymous> (/opt/rust/bytecode.js:1:1435)
at l._compile (/opt/rust/bytecode.js:1:3140)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Module._load (node:internal/modules/cjs/loader:1104:12)
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
The thing is that locally everything’s working. I connected my project with Neon database and it works correctly, create tables, also CRUD operations are working. Only when I deploy my website in Vercel, it returns this error. Like I said I even integrate Vercel with Neon but still returning this error.
It looks like on the Vercel level there is some issue.
Do you have any idea what it can be?