nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

with-tailwind Starter repo fails to deploy on vercel #299

Closed Jkroeger123 closed 1 year ago

Jkroeger123 commented 1 year ago

Using the "Deploy" button on the Solito with Tailwind starter repo found here, the deployment fails with the following error:

Error: The file "/vercel/path0/apps/next/.next/routes-manifest.json" couldn't be found. This is normally caused by a misconfiguration in your project.

I believe turbo may be causing the issue as it seems 0 tasks are found by it's build command (as seen in the attached log.)

log.txt

nandorojo commented 1 year ago

i’ve heard of this issue, will have to look when i have time. thanks!

Jkroeger123 commented 1 year ago

great thanks! It is currently a blocker on a project so I'll be digging into this as well, will update here if I find anything!

nandorojo commented 1 year ago

yeah i imagine. what about local next build?

Jkroeger123 commented 1 year ago

next build works fine, it looks like the issue is npx turbo run build --filter=next... that runs in vercel. This filter is looking for a workspace called 'next', however in the repo the next project is named 'next-app'. Changing the project name to 'next' seems to fix the issue, although I wonder why the turbo filter changed all of a sudden? Looking at my deployment history turbo used to correctly filter, running the command npx turbo run build --filter={./apps/next}...

nandorojo commented 1 year ago

they maybe previously looked at folder names? or maybe someone in a PR got this wrong. could you PR a fix by filtering for next-app?

nandorojo commented 1 year ago

oh wait, is this build script auto configured by vercel?

Jkroeger123 commented 1 year ago

Yes I believe it is auto configured, so I think we'd really only be able to rename the next workspace on our side. Although I am starting to think there is a deeper root cause then a messed up filter.

I've been getting very strange build errors on Vercel, requests timing out, etc. (For example I just tried to deploy solito-with-nativewind again and turbo filtered correctly but the deployment failed with Error: error:0308010C:digital envelope routines::unsupported)

Luckily I was able to get some green builds yesterday which unblocked me, although I'm keen on figuring out what's going on here so it doesn't block anyone else (for me the starter repo still doesn't deploy)

nandorojo commented 1 year ago

I know how to fix that. Give me a few

nandorojo commented 1 year ago

Try the following:

Builid command: cd ../.. && npx turbo run build --filter=next-app Node Version: 16.x

Jkroeger123 commented 1 year ago

That did it, thanks! Specifically switching node versions is what did the trick. Do you think it's necessary to specify a node version in the package.json?

nandorojo commented 1 year ago

yeah i’ll probably specify an engine there. vercel doesn’t seem to let us configure this via the deploy button, but maybe it’s an option in vercel.json?

nandorojo commented 1 year ago

Can you try adding this to your root package.json, and then set the vercel node version to some other one, and see if it still works?


  "engines": {
    "node": "^16"
  }
Jkroeger123 commented 1 year ago

looking at the vercel docs here, it looks like this should work, although I am getting an incompatible module error, digging further into the nuances here ill update soon

anthonyshew commented 1 year ago

@Jkroeger123 In a monorepo, you will want to set the engines in the package.json of the app itself rather than the monorepo root. 👍

Jkroeger123 commented 1 year ago

ah yup that did it thanks @anthonyshew ! I'll get a PR up with this fix