When I try to access the user page on my quizzer website (Quizzer) using either the guest or custom account log in, I’m getting an error saying: Page Not Found
Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site. (Quizzer)
The website worked perfectly in development, so I’m wondering why netlify isn’t handling it well. Can I please get some assistance with getting my site back online?
@Emi_3 It’s fine, it’s just common for those seeking assistance to start by “asking if they can have assistance”, which while “polite”, slows down how fast you get helped.
For future reference here, or anywhere, the fastest way for help with any technical questions is to front-load your post with as many details as you can:
What you’re working with, (the platform, system, framework, language info)
What the issue is, (where you’re seeing it, any error logs)
What you suspect it may be
What you’ve already tried
Access to the code or a minimum reproducible example or steps to recreate
If you write a detailed post you will find that it can act like Rubber duck debugging and you’ll solve your own problem before you even hit “post”.
It’s not usually possible to discern why an error is occurring from output alone, so you’ll often need to provide source code, especially in situations with claims along the lines of “it works locally”. As the easiest way for someone to confirm that, is to pull it down and try themselves.
Your repository is set to private, so I’ve not been able to access it.
@Emi_3 The rule that you’ve added in the _redirects file is for when the output is a Single Page Application (SPA), and is to ensure that any routes which don’t actually exist as files, are served the main index.html file.
You can tell it’s not working though, since you’re getting the standard Netlify 404 page, and the reason it’s not working is due to where the file is placed. You have the _redirects file in the root of your repository, but it needs to be in the folder that you’re deploying, in this case /dist/.
Additionally, you can see that your build doesn’t produce a logged-in.html file…
So once you move the _redirects file, (which you can do however you would like with Parcel, or by using a copy command after Parcel has executed), I would expect that what you would find accessing the /logged-in.html path would return the contents of the /index.html file… which is likely still not what you want.
In addition to what @nathanmartin has said, if you build the project locally (which I did) you’ll notice the logged-out.html file doesn’t exist in the dist directory. This is because you haven’t explicitly told Parcel to build it and as it isn’t reference in another file (as sign-in.html is in index.html) Parcel doesn’t automatically include it.
@jasiqli I believe you mean logged-in.html, but you’re entirely correct, I’d forgot to mention that there is in fact a logged-in.html file in the root, but that it’s not currently ending up in the /dist folder due to the way that Parcel works.
@Emi_3 One way to test what will happen on Netlify is to run your build command locally, go into the /dist folder and then run npx serve, in the case of a build like this which doesn’t actually need redirects or any middleware, if your build works when served as static files, it will work on Netlify.
The _redirects file isn’t in your repository anymore, your most recent commit deleted it.
Your .gitignore understandably has dist specified in it, to prevent output files from ending up in the repository.
Usually you would copy the file into the dist as part of your build, to ensure a reproducible build that doesn’t rely on any artifacts, so if the dist folder is completely destroyed, running the build produces everything you need for a deployment.
I really appreciate the help from both you and @jasiqli While I didn’t understand the deployment process that well before, I think I’m finally starting to get it thanks to y’all. I’ve been stuck here for a good minute, so I’m quite happy I could finally get some assistance. I’ll also make sure to keep note of the advice regarding parcel as well