Search code examples
reactjsdeploymentvercel

Vercel deployment failure


i was trying to publish my website via Vercel but somehow i couldn't... I have the api url and token in index.js in consts folder. I've tried to put api info in the .env file but i couldn't do that either.

Here is my files and the Vercel's error

I would be really happy if i use some help. Thank you.

My files

What vercel says


Solution

  • Keep all your .js files inside src folder. Looking at your problem ,it looks like your index.js falls outside src folder. Try placing it directly in your src folder like your App.js, it should work fine. Also, Run npm run build in your VS Code terminal before deploying it.