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

[v2] Warning in browser console during gatsby serve (after build) #7713

Closed
rtm619 opened this issue Aug 29, 2018 · 21 comments · Fixed by #13935
Closed

[v2] Warning in browser console during gatsby serve (after build) #7713

rtm619 opened this issue Aug 29, 2018 · 21 comments · Fixed by #13935
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@rtm619
Copy link

rtm619 commented Aug 29, 2018

Summary

Chrome throws a warning in console during gatsby serve.

Relevant information

The warning is : The resource http://localhost:9000/static/d/708/path---en-869-cd4-rxXbyoDAkJ1rXH07VFHKZjmdHQI.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

It doesn't cause any problems, just throws a warning. Any clue as to why it does?

Environment (if relevant)

System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Binaries:
Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 41.16299.611.0
npmPackages:
gatsby: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-image: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-link: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-canonical-urls: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-google-analytics: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-google-tagmanager: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-i18n: 0.4.2 => 0.4.2
gatsby-plugin-manifest: 2.0.2-rc.0 => 2.0.2-rc.0
gatsby-plugin-offline: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-purify-css: 2.2.1 => 2.2.1
gatsby-plugin-react-helmet: 3.0.0-rc.0 => 3.0.0-rc.0
gatsby-plugin-remove-trailing-slashes: ^1.0.9 => 1.0.9
gatsby-plugin-robots-txt: 1.3.0 => 1.3.0
gatsby-plugin-sharp: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-plugin-sitemap: 2.0.0-rc.0 => 2.0.0-rc.0
gatsby-source-contentful: 2.0.1-rc.0 => 2.0.1-rc.0
gatsby-transformer-remark: 2.1.1-rc.0 => 2.1.1-rc.0
gatsby-transformer-sharp: 2.1.1-rc.0 => 2.1.1-rc.0

@rtm619 rtm619 closed this as completed Aug 30, 2018
@johncmunson
Copy link
Contributor

I'm getting this same issue, both when using gatsby serve and after deploying to netlify

@johncmunson johncmunson reopened this Nov 30, 2018
@shannonjensen
Copy link

I am getting the same issue, throwing 7 of the same warnings for various js bundles

@bogdancss
Copy link
Contributor

same here

@RJGrunau
Copy link

RJGrunau commented Dec 6, 2018

I am as well. @rtm619 did you find solution?

@coughlanio
Copy link

I'm getting the following locally & running in S3 and Netlify:

The resource https://foo.bar/static/d/520/path---offline-plugin-app-shell-fallback-a-30-c5a-NZuapzHg3X9TaN1iIixfv1W23E.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

@ghost
Copy link

ghost commented Jan 26, 2019

The site of Gatsby and my new npm.cardiv.de are throwing the same warnings for me (Chrome), but both for a json file which seems to come from the offline plugin.

The same as @coughlanio mentioned. Maybe because it's a fallback file that doesn't need to be loaded in Chrome (and therefore, the browser doesn't use that file)?

@pieh
Copy link
Contributor

pieh commented Feb 12, 2019

We should defenitely drop preload link for .json from offline shell.

If anyone would want to take a stab at this:
We would need gatsby-ssr.js file in https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-offline/src

In there we would want to implement onPreRenderHTML API hook:

  • check if pathname is /offline-plugin-app-shell-fallback/ (seems like pathname is not documented in our API reference :/)
  • get list of head components (getHeadComponents)
  • filter out "preload" component for .json (we might want to check if as attribute is "fetch" and maybe for sanity check href (if it contains/starts with /static/d/ )
  • use replaceHeadComponents to update the list (with one that has the preload link for that .json` file removed)

@pieh pieh added help wanted Issue with a clear description that the community can help with. type: bug An issue or pull request relating to a bug in Gatsby and removed status: inkteam to review labels Feb 12, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 5, 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 Mar 5, 2019
@kalm42
Copy link

kalm42 commented Mar 7, 2019

Replying. I'll take a stab at this.

@gatsbot
Copy link

gatsbot bot commented Mar 18, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Mar 18, 2019
@Razatastic
Copy link

At first, this only happened locally, but now it's also happening on Netlify. Any resolution for this yet?

@judah-firewood
Copy link

Same

@jeroenoomsNL
Copy link

Same here!

@hupe1980
Copy link
Contributor

hupe1980 commented May 12, 2019

Same here!
@pieh I have implemented your solution and created a PR #13935

@futhr
Copy link

futhr commented Jul 22, 2019

The issue is still there using:

gatsby-plugin-offline v2.2.4
gatsby v2.13.31

The resource https://mydomain.netlify.com/page-data/offline-plugin-app-shell-fallback/page-data.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

@ytric
Copy link

ytric commented Mar 7, 2020

I am getting the same issue. any update?

@barrymichaeldoyle
Copy link

A few months later and I'm still experiencing the same issue. Any updates?

@Z11
Copy link

Z11 commented Jun 16, 2020

Yeah i'm still seeing this issue

@Thieffen
Copy link

Thieffen commented Mar 7, 2021

Same. Just updated from gatsby v2 to v3

@amankataria216
Copy link

Any update how to fix this issue

@zmcx16
Copy link

zmcx16 commented Jun 13, 2021

same issue on firefox, gatsby-plugin-offline": "^3.0.32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.