I have converted a project in an NX mono-repo from CRA to Remix. I can build and run it locally with no problems. However, no matter what I do at deploy, I’m just getting the Page Not Found error.
Thanks for reaching out. I know you state you have tried everything you have found online-- did you see this guide yet? This is the best place to start for “Page Not Found” issues.
If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track
If none of the above resources help, please write back and let us know. We will need to see your repo in addition to your site link.
Hi Hillary - so, I’m continuing this thread as I’m not sure if this is resolved. This is a weird one. When I deploy to develop now, and it auto-deploys a dev branch, that works fine. If I merge to main locally and push, and that triggers a production build, I’m still getting the page not found error. I can push the develop build to production via your uI and that works fine - what would cause something like that to happen?
That’s the cause of problem here. I don’t think you’ve done anything wrong - this appears to be something weird on our end. I’ll confirm with the devs as to why the redirect is not triggering and let you know as we have more details.
But, I don’t understand why this is happening? I’m pretty sure that directory is build in the build process. I’m talking about pushing the EXACT same code to two branches - one deploys to your ‘temporary release’ and one to a ‘production release’. The temporary builds that directory just fine and works. The production doesn’t
Is there an internal setting that might impact this, seeing that the code is identical?
Hi, @justinhandley. All the settings I can see identical for both builds but only one says the directory is missing.
It might help to create the directory in the repo. Would you please double check that the directory exists in the production branch?
There is a “brute force” debugging method as well which is to print the contents of that directory to the build logs after the build command completes.
The current build command is this:
yarn build:remix
To log the contents of that directory, you can use the “logical AND” and the command tree to log the directory contents. The “logical AND” is important as tree will almost alway return a zero exit code. If you don’t use the “logical AND” it will mean that all builds, even builds with errors, will succeed. That would publish builds with errors and we don’t want that happening.
Using the “logical AND” with tree the new build command might look like this:
yarn build:remix && tree apps/remix/.netlify/functions-internal
That is saying:
Only if the build itself succeeds, then run this tree command to print the filenames and directories under apps/remix/.netlify/functions-internal.
This will help us to determine if the directory is indeed missing or not. If it is missing, then debugging why it is missing is the next step. If the directory is there, then something else is happening. Either way, we will have more information than we do now.