-
My repo initially had only 1 project, and this project started from the next-redux template, fully integrated with vercel meaning that I only had to type vercel on the CLI and the build was a success by using all default configs. Now I have added another project into the same repo, this second project is just a library, but its a project on its own, with its own dependencies. My nextjs web app now uses a few libraries from this second project. The only way I was able to make it all build was by overriding the build command and using a sh script, just like this tutorial shows: https://www.storyblok.com/tp/different-build-commands-branch-name-vercel The problem now is that when I access the vercel deployment link, I get a 404 I was only able to make it all build when I changed the framework preset to other (as you can see on the image above) on the build settings on vercel control panel. As per the tutorial - my vercel.sh script is super simple:
I guess what I'm missing is configuring manually the way the nextjs framework preset was deploying the nextjs project and setting the index page correctly so i don't get a 404. But how do I achieve this? Better question than that may be: would that be the best approach? I have the impression this is over complicating things. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Some more info See the two lines in between asterisk
|
Beta Was this translation helpful? Give feedback.
-
I wonder if someone can comment out if this actually possible, otherwise I'd look for another solution |
Beta Was this translation helpful? Give feedback.
-
After some tests and some research I found two things
Now I gotta say I'm a bit disappointed with vercel team support here on github. Worse even, turborepo is now a product owned by vercel, acquired last December. |
Beta Was this translation helpful? Give feedback.
After some tests and some research I found two things
I since the nextjs project is on the root of my repo (obviously alongside with its package.json) I tested copying all the node modules dependencies from the other project, into the package.json for the nextjs project and it worked.
So apparently for this to work all the modules must be installed in this specific way.
I'll use this workaround for now, although obviously not ideal
decided to look for some kind of library that will help me handle this task
Quite a few people have recommended turborepo and thats the one I'll give a shot first, but wont update here since it will be out of scope
Now I gotta say I'm a bit disappointed w…