I'm try to deploy my Node.js express app to vercel, But i'm getting this error "This serverless function has crashed." I don't understand what's the problem.
I have an index.js file in the root project folder, Initial the app with routes and starts to listen... and it's working on vercel.
But when i'm trying to connect my Sequelize Database like this:
./api/db/index.js
const {Sequelize, DataTypes} = require("sequelize");
const sequelize = new Sequelize(
process.env.DATABASE_NAME,
process.env.MYSQL_USER,
process.env.MYSQL_PASSWORD,
{
host: process.env.DATABASE_HOST,
dialect: 'mysql',
dialectOptions: {
ssl: {
rejectUnauthorized: true,
},
},
define: {
timestamps: false
}
});
Locally it works but on vercel it throws an error of "This Serverless Function has crashed"
Can someone help me figure it out?
I'm trying to deploy to vercel a very early stage node.js app just to check. But I get an error "This serverless function has crashed."
/apiis reserved for serverless functions on Vercel