I thought it’s pretty straightforward thing by just running npx vercel. Any ideas what could go wrong? I ran npm run build in the local env and it builds without any problem. I am able to serve the build using npm run serve command.
npx vercel serve the website in development
To launch the build to production you have to execute npx vercel --prod after executing npx vercel
Anyways, the development url will be something like this vercelProjectName-vercelUsername.vercel.app instead of vercelProjectName.vercel.app which is the production build
Also, another thing to check is the url returned by the terminal once you do npx vercel:
(The Preview One). Is it the same as this one “https://mikitours-frontity.vercel.app/”
Basically, whenever I run npm install in the root of the project, the node_modules folder was created at packages/mars-theme/node_modules which caused some modules to be duplicated and therefore breaking the app.
Removing packages/mars-theme/node_modules brought my app to life again (I could run it again with npm run dev without errors).
However, I still couldn’t deploy the app until I reset/removed the package-lock.json at the root’s directory.
After this, running npm install inside of an root’s directory doesn’t create packages/mars-theme/node_modules folder any more.
I guess this was the main problem with the deploy, because in the deployment process npm install must be run.
Does this makes sense? I lost several hours on this today, debugging.
Yes, it makes totally sense. The package-lock.json keep the dependencies locations so it also need to be removed for a complete re-install.
We’ve detected this is not very clear for the final users and we’re working on this (both the documentation and the framework) so the final users don’t have to worry about this.