Skip to content
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

Missing resources for / #11524

Closed
Jivings opened this issue Feb 3, 2019 · 112 comments
Closed

Missing resources for / #11524

Jivings opened this issue Feb 3, 2019 · 112 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@Jivings
Copy link
Contributor

Jivings commented Feb 3, 2019

Summary

Periodically on my production site I'm seeing the following error;

Error: Missing resources for /
  at render(./.cache/ensure-resources.js:133:17)
  at Sg(./node_modules/react-dom/cjs/react-dom.production.min.js:169:129)
  at Hh(./node_modules/react-dom/cjs/react-dom.production.min.js:214:16)
  at Ih(./node_modules/react-dom/cjs/react-dom.production.min.js:215:274)
  at ji(./node_modules/react-dom/cjs/react-dom.production.min.js:230:233)
  at ki(./node_modules/react-dom/cjs/react-dom.production.min.js:229:143)
  at Fh(./node_modules/react-dom/cjs/react-dom.production.min.js:226:196)
  at bg(./node_modules/react-dom/cjs/react-dom.production.min.js:224:28)
  at qi(./node_modules/react-dom/cjs/react-dom.production.min.js:243:14)
  at render(./node_modules/react-dom/cjs/react-dom.production.min.js:251:109)
  at oi(./node_modules/react-dom/cjs/react-dom.production.min.js:254:364)
  at Ai(./node_modules/react-dom/cjs/react-dom.production.min.js:254:350)
  at apply(./.cache/production-app.js:114:7)
  at r(./node_modules/@sentry/browser/dist/index.js:3114:1)

It seems like sometimes this causes the site to not render at all and just show a blank page.

Relevant information

You can see the trace on Sentry here

Environment (if relevant)

This is the env on which the site is built;

  System:
    OS: macOS High Sierra 10.13.2
    CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: 1.9.4 - ~/.nvm/versions/node/v8.11.1/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.11.1/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Safari: 11.0.2
  npmPackages:
    gatsby: ^2.0.19 => 2.0.72
    gatsby-image: ^2.0.15 => 2.0.20
    gatsby-plugin-create-client-paths: ^2.0.2 => 2.0.2
    gatsby-plugin-google-gtag: ^1.0.8 => 1.0.8
    gatsby-plugin-manifest: ^2.0.5 => 2.0.10
    gatsby-plugin-offline: ^2.0.11 => 2.0.17
    gatsby-plugin-page-transitions: ^1.0.7 => 1.0.7
    gatsby-plugin-react-helmet: ^3.0.0 => 3.0.2
    gatsby-plugin-sharp: ^2.0.18 => 2.0.18
    gatsby-plugin-stripe-elements: ^1.0.9 => 1.0.9
    gatsby-plugin-twitter: ^2.0.8 => 2.0.8
    gatsby-source-filesystem: ^2.0.4 => 2.0.12
    gatsby-transformer-sharp: ^2.1.12 => 2.1.12
  npmGlobalPackages:
    gatsby-cli: 2.0.0-rc.1
    gatsby-plugin-countly: 0.2.0

No idea where to start with debugging this so any help is appreciated!

@Undistraction
Copy link
Contributor

Might be related to #11453

@Jivings
Copy link
Contributor Author

Jivings commented Feb 3, 2019

Maybe, though there's no 404 stuff involved here.

@sidharthachatterjee sidharthachatterjee added type: question or discussion Issue discussing or asking a question about Gatsby status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. labels Feb 4, 2019
@sidharthachatterjee
Copy link
Contributor

Sorry you're seeing this, @Jivings

Could you please link to a minimal reproduction if possible?

@Jivings
Copy link
Contributor Author

Jivings commented Feb 5, 2019

I haven't been able to reproduce locally 🙁 Is there any more information I can get you, or does the sentry report help at all? Under what circumstances might this occur so that I may be able to narrow it down?

@EricSSartorius
Copy link

I am also seeing this but only after deploying, I can't reproduce locally.

Uncaught Error: Missing resources for /store/
    at t.n.render (ensure-resources.js:135)
    at Xo (react-dom.production.min.js:156)
    at Qo (react-dom.production.min.js:155)
    at ti (react-dom.production.min.js:162)
    at Oi (react-dom.production.min.js:192)
    at ji (react-dom.production.min.js:193)
    at fa (react-dom.production.min.js:205)
    at sa (react-dom.production.min.js:204)
    at Mi (react-dom.production.min.js:200)
    at ya (react-dom.production.min.js:218)

I have noticed though that I only get this error on a branch where I tried to removed ThemeProvider (styled-components) from my code and I am guessing somewhere things got messed up in the file structure since no packages were added/updated/removed. Will update if I pinpoint the cause but there isn't much to go by.

@italodr
Copy link

italodr commented Feb 6, 2019

I am having the same issue here... first, sorry for my english, i'm spanish-speaker ¯_(ツ)_/¯

Error: Missing resources for /...
    at t.n.render (ensure-resources.js:135)
    at Ri (react-dom.production.min.js:169)
    at Ci (react-dom.production.min.js:168)
    at Li (react-dom.production.min.js:176)
    at Ba (react-dom.production.min.js:221)
    at Ha (react-dom.production.min.js:222)
    at Pl (react-dom.production.min.js:238)
    at Tl (react-dom.production.min.js:237)
    at wl (react-dom.production.min.js:234)
    at Qa (react-dom.production.min.js:232)

First of all, a little of context, I had an issue related to a carousel package Tiny Slider which was using window, so I search for different carousels with SSR implemented and I found react-responsive-carousel. I works great with what I needed, but only in develop.

The mentioned error happens in two related scenarios:

Scenario 1
I use styled-components to style my slide, but adding mixins broke my builds. I found that adding gatsby-plugin-styled-components solved the issue; and it works, but... scenario 2 happend

Scenario 2
Now my build is working and I can see my page with styles. But, my carousel does not work, it does nothing!!! 😱... The styles are looking great though... 😅
So I just remove the gatsby-plugin-styled-components and the script worked again, but not my styles 🙃

Hope this gives some hints to find and solve the issue

@dackers86
Copy link

Hi Guys.

Not sure if this helps but I had a similar issue, it turns out my missing resource was a missing (production) env variable for firebase. This in turn seemed to effect my images - this must have had an impact on a build step

Can provide more information if required...

@pieh
Copy link
Contributor

pieh commented Feb 14, 2019

@Jivings can you update gatsby and gatsby-plugin-offline package? this happens when you make new build but resources from previous are no longer available (so html cached by offline plugin tries to use not available resources). In newer gatsby/offline packages versions we added reload after service worker updates to not leave site in unusable state

@efd1
Copy link

efd1 commented Feb 15, 2019

In my case, I changed an import from import { Link } from './' to import { Link } from './Link' (in my file /components/footer.js), and it did fix the error "Missing resources for /". It was a circular dependency I guess. But I don't know if it will fix yours
Edit: If the error happens periodically, I think the solution from @pieh above have better chances to fix it.

@marcysutton
Copy link
Contributor

marcysutton commented Feb 21, 2019

I'm getting these errors but only in IE11. I'm not sure exactly which resources are failing since it's only occurring in one browser, as far as I can tell, but I do see some errors in react-dom (see screenshots below). I updated all of my Gatsby dependencies to their latest versions and added a polyfill in case it was choking on Symbol or something too modern, yet the errors still occur. I also have image loading problems in IE11, too, I believe like what is discussed in #4021. If I remove all images and the offline plugin, I get no errors on page load but I do when I navigate to any other pages, even if they don't contain images. It looks like some JS fails to load and IE presents probably the HTML 404 page instead. So there's definitely something wonky going on here.

I'm working off of my develop branch deployed to Netlify to test out fixes on various devices.
Here's the latest debug build if you want to test it: https://5c6ee3b943e6c400080a5a8b--marcysutton.netlify.com/about/
Here's my live site, which definitely has all of the brokenness in IE11 still: https://marcysutton.com
And here's my site source: https://github.com/marcysutton/gatsby-site

Here are some screenshots from my VM:

stack trace
script errors in console
react-dom looks related

@Undistraction
Copy link
Contributor

Undistraction commented Feb 23, 2019

@marcysutton Have you made any headway with this? I'm seeing the same thing in IE11 only. No issues in any other browsers.

@marcysutton
Copy link
Contributor

Not yet! @sidharthachatterjee or @pieh, is this enough information to debug? Pretty blocking issue in IE11 at the moment.

@marcysutton
Copy link
Contributor

@Undistraction I have some good news: the team helped me debug this issue, and they pointed out that IE11 is having trouble with uncompiled arrow functions in a plugin (gatsby-background-image). They're discussing changes to Gatsby core to account for this, but in the meantime you should be able to get around it by compiling any plugins that are causing issues: https://www.gatsbyjs.org/packages/gatsby-plugin-compile-es6-packages/?=compile

Here's where I used it on my site: https://github.com/marcysutton/gatsby-site/blob/develop/gatsby-config.js#L107

Let us know if you still have any trouble!

ines added a commit to explosion/spaCy that referenced this issue Feb 26, 2019
@luukdv
Copy link

luukdv commented Feb 26, 2019

Same issue here, seeing this periodically on websites I haven't visited for a few days (the Gatsby website as well). Not on IE11 but Chrome. After a few seconds of blank page, there's a refresh after which everything is working again.

Versions of one example:
gatsby: 2.0.118
gatsby-plugin-offline: 2.0.23

@thebarty
Copy link

I am getting this error in IE (edge mode).

It is pointing to the file react-dom.production.min.js in line 1 char 195183.

when clicking on the error in IE it points to this code:

if(pi)throw a=qi,qi=null,pi=!1,a;}

@Undistraction
Copy link
Contributor

Undistraction commented Feb 28, 2019

@marcysutton Thanks for the update. I hadn't spotted that syntax error in your console. For us we have no error at all. The page navigation is completely broken in IE11, and the page doesn't hydrate. On a page refresh we do get the missing resources error. We've had to drop IE11 support because there is nothing to go on. No issues with any other browser. My hunch is that this is a polyfill issue, but that the error is being swallowed somewhere, but that's just a guess. I don't understand how the page hydration can crash without any error in the console.

@rammoozz
Copy link

rammoozz commented Mar 7, 2019

I am getting this error on (1st) load. Seems to clear after reload. Production / Firebase hosting.
Error: Missing resources for /

@DSchau
Copy link
Contributor

DSchau commented Mar 7, 2019

@rkhayat could you link to a URL or better yet provide a reproduction?

Thanks!

@Undistraction
Copy link
Contributor

FWIW I wrote up my experience with this issue in #12399 It might be of help to anyone hitting the Missing resources for / error.

@schwiet
Copy link

schwiet commented Mar 11, 2019

I was having what seems like a similar issue: One could navigate the site fine, but on any page, if they did a refresh, the page would be blank and I'd see Error: Missing resources for /<path>. A hard refresh or clearing of cache would reload the page, but again normal refreshes would show a blank page.

Not being able to reproduce this locally with gatsby server, I suspected it was a CDN issue, so I invalidated the root directory in my CloudFront distribution which seems to have resolved this issue for me. I'm still not sure exactly what was happening, but suspect some references got outdated. Hope this helps someone else.

@gatsbot
Copy link

gatsbot bot commented Apr 1, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Apr 1, 2019
@luukdv
Copy link

luukdv commented Apr 2, 2019

@gatsbyjs-read-only-user Not stale 😬

@onetwothreebutter
Copy link

@Undistraction I have some good news: the team helped me debug this issue, and they pointed out that IE11 is having trouble with uncompiled arrow functions in a plugin (gatsby-background-image). They're discussing changes to Gatsby core to account for this, but in the meantime you should be able to get around it by compiling any plugins that are causing issues: https://www.gatsbyjs.org/packages/gatsby-plugin-compile-es6-packages/?=compile

Here's where I used it on my site: https://github.com/marcysutton/gatsby-site/blob/develop/gatsby-config.js#L107

Let us know if you still have any trouble!

@marcysutton How did you identify the plugins/modules that contain uncompiled arrow functions?

@Rajarml
Copy link

Rajarml commented Jun 19, 2019

The version rollback down to 2.8.5 from 2.9.4 seems to have fixed the issue for us.
In our case it seems to be related to some missing pages-manifest-{hash}.js[.map] files.
The 2.9.3 and 2.9.4 version have some potential breaking changes: see #14732 (from Gatsby package changelogs: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/CHANGELOG.md).
For confirming this a last test for us should be to upgrade Gatsby up to 2.9.2.

@KyleAMathews
Copy link
Contributor

FYI @Moocar has a PR up to make resource loading more robust e.g. retry failed or partially loaded resources #14889

If any of you have time to review / try that, it'd be much appreciated. I apologize for not catching this earlier — it wasn't clear how widespread this was or what the cause was before digging in recently with @Moocar

@thomascorthouts
Copy link
Contributor

thomascorthouts commented Jun 19, 2019

I don't know whether it'll help more, but I had it on https://gatsbyjs.org/contributing a few minutes ago:

Screenshot 2019-06-19 at 17 04 17

Was fixed after a reload, but seemed worth to put here @KyleAMathews

@vtenfys
Copy link
Contributor

vtenfys commented Jun 19, 2019

I believe this could be an issue with the offline plugin configuration, since it might not be correctly checking for changes with page manifest files, and therefore keeping old ones about.

Going to try and look at this next week with @wardpeet since I've written a lot of the offline plugin - sadly I've been really busy recently with exams and planning to move house so haven't been able to check out all these changes properly 😞

@jackhair
Copy link

@davidbailey00 Before you get too deep in debugging, we experience this with or without the offline plugin.

@wilcoxmd
Copy link

@davidbailey00 we also were having the issue without the offline plugin. It is in my node modules, but still commented out of my config file.

@jaredsilver
Copy link
Contributor

We are also experiencing this without the offline plugin installed.

@KyleAMathews
Copy link
Contributor

@davidbailey00 yeah we think the main fix is correctly handling some unusual error cases for ajax requests & adding retry logic #14889

@KyleAMathews
Copy link
Contributor

We've deployed the PR to gatsbyjs.org for the last ~4-5 days and things are looking really good! There's been no new "missing resources" events since the deploy.

#14889 (comment)

@KyleAMathews
Copy link
Contributor

@wardpeet is working on some tests to simulate network problems but we should have this out in the next 24 hours.

@jackhair
Copy link

Thank you @KyleAMathews can't wait to get this running!

@brotzky
Copy link
Contributor

brotzky commented Jun 26, 2019

@KyleAMathews thanks to you and your team for that update!

@gregwhitworth
Copy link

@KyleAMathews I'm having this issue still occurring on my site. locally it works fine and in prod it doesn't. Also, I'm seeing it 100% of the time, not sporadically like some of the comments above. That said, I've looked through most of the solutions and utilizing them hasn't resulted in a fix. Do you have a specific version of Gatsby that has the fix in it so I can ensure that I'm hitting something different?

I'm willing to share URL privately as well as add contrib access to the private repo if someone from the gatsby team wants to take a look (DM me on twitter). Thanks for any tips/suggestions - to be clear the things I've tested are:

  • Adding service worker reload on gatsby-browser.js
  • Removing offline plugin
  • Updating all node modules
  • Ensuring that the imports are not referenced using .

@wardpeet
Copy link
Contributor

We should have this one fixed in the latest gatsby release [email protected]. We have ran it on gatsbyjs.org and the errors dissapeared for us.

@KyleAMathews
Copy link
Contributor

Please upgrade and let us know if there's any more trouble! Closing this for now.

@gregwhitworth
Copy link

gregwhitworth commented Jul 2, 2019

@KyleAMathews Thanks - I did, unfortunately this didn't fix it although I think it's something else as the Missing Resources error went away but the primary issue is still there so I filed issue #15322

@jackhair
Copy link

jackhair commented Jul 2, 2019

@KyleAMathews Thanks - I did, unfortunately this didn't fix it although I think it's something else as the Missing Resources error went away but the primary issue is still there so I filed issue #15322

We won't get Missing Resources because it was deleted and replaced with a different error: https://github.com/gatsbyjs/gatsby/pull/14889/files#diff-3182dbe2979ea0744c50242668edc572L173

We recently deployed this fix, going to check out bug logs for new/different errors.

EDIT: yeah looks like this.loadPageDataJson(...).then(...).finally is not a function is the new missing resources

@wardpeet
Copy link
Contributor

wardpeet commented Jul 2, 2019

@jackhair what browser are you testing on? I'm pretty sure we added a finally polyfill. Might be wrong though.

mind sharing your repo? or a small reproduction?

@jackhair
Copy link

jackhair commented Jul 2, 2019

@jackhair what browser are you testing on? I'm pretty sure we added a finally polyfill. Might be wrong though.

mind sharing your repo? or a small reproduction?

We're seeing this across several browsers in production:

Screen Shot 2019-07-02 at 13 29 03

@wardpeet
Copy link
Contributor

wardpeet commented Jul 2, 2019

Do you mind sharing your website url so I can have a look and maybe debug it a bit?

@jackhair
Copy link

jackhair commented Jul 2, 2019

Do you mind sharing your website url so I can have a look and maybe debug it a bit?

Sure! https://ritual.com

@wardpeet
Copy link
Contributor

wardpeet commented Jul 4, 2019

@jackhair I can confirm the bug. Could you make a new issue with the info provided above?

@eknowles
Copy link
Contributor

@wardpeet @jackhair we're also getting this finally polyfill issue, is there a new issue added? can it ref this one please?

@jackhair
Copy link

@eknowles @wardpeet Sorry not had time to write a bug ticket for this yet. If you have a spare moment and want to create one, I can back it up with my own data too.

@eknowles
Copy link
Contributor

@wardpeet @jackhair I managed to track down our issue with the finally polyfill.

We found one of our dependencies was including babel-polyfill with useBuiltins: usage instead of entry.

Either way we had to downgrade redux-api-middleware (not related to gatbsy).
agraboso/redux-api-middleware@v2.3.0...v3.0.0

this solved our finally bug. I would recommend following the stack trace up the chain and see which lib is the culprit as the Promise polyfill might be getting overridden but a nasty lib.

@wardpeet
Copy link
Contributor

wardpeet commented Aug 1, 2019

Thanks, we've seen this before with node_modules and babel-runtime. I'll have to rethink on how we can fix this in the future or at least give a proper error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests