-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Error On Production 404 page with react-dom ensure-resources error #11453
Comments
@Undistraction Could you maybe try to make a minimal reproduction of this from your private repository? I'm happy to take a look once I can reproduce this |
@sidharthacgatterjee thanks. Yes I'll try and make a repro tomorrow. Was hoping it might be something obvious. |
I think I have same or similar issue, and I'm only using the starter app - no code modifications. Doing this because I was creating my own app and that threw errors, so decided I should make sure the native example works. Hmm.
then I went to
|
@sidharthachatterjee Sorry. Didn't manage to put a repro together and now on holiday for a week. Looks to me like EnsureResources is trying to get resources for a page that doesn't exist (the page which triggered the 404 page will never exist, that is why it triggered the 404 page), and erroring when it can't. It should actually be trying to get resources for the 404 page itself, or at least not trying to get resources for a page that doesn't exist. |
Ditto on the errors |
This was a really weird one that was actually caused by gatsby-plugin-remove-trailing-slashes. I don't fully understand the exact cause, but it caused other issues as well, including issues with history and the back button. If you are facing similar issues I strongly suggest you rip that sucker out of your project and see if that does it for you. |
I'm seeing a similar issue, but nothing is getting reported to the console. Navigating to any 404 from a link within the site works properly, but getting to a 404 from an external link or by tampering with the URL leaves the page in a broken state where navigation only updates the URL but the actual page doesn't get updated properly. Weirdest part is I can only reproduce this in my production environment on Netlify. |
@alexkirsz Have you got any redirects set up? |
@Undistraction Here's my _redirects file:
I've created redirects for both these 404 pages in Gatsby. I've also set up a |
@alexkirsz The reason I ask is because our problem was related to a lack of a trailing slash, not on the error page, but on the page triggering the error page. We are deploying to Apache, and it didn't like the fact that we were using urls Sorry I can't be of more help. |
@Undistraction / @alexkirsz did either of you have any additional insights / learnings from this issue? It seems to be happening to me as well, but I just disabled |
@himynameitimli tbh we've had so many problems with Gatsby in production that I've rather lost track of what solved which issue. |
Description
I have a custom 404 page at
/404
. I can view this successfully in development. However on production, navigating to a non-existent page results in the page loading, but with all links and any components non-functional (For example there is a mailing list signup component in the footer which does not function). This includes links on the page and within the header and footer which are provided by my template.Clicking on any link does change the URL in the URL bar, but no navigation takes place.
The following error is displayed in the console on page load:
The path to 'ensure-resources.js' is
webpack:///./.cache/ensure-resources.js
Steps to reproduce
I cannot share the URL unfortunately as this is not public yet.
Expected result
Actual result
Environment
The text was updated successfully, but these errors were encountered: