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
Lighthouse crossorigin warnings despite using this plugin #369
Comments
First of all, thanks for the detailed feedback, this is a perfect issue-reporting 😊 I link #351 where we discussed it and if you want to add minimatch and raising a PR you're more than welcome 😊 |
Thanks for looking into this. Are you sure #351 is the same root cause? |
I think so, you could try to change the code of the plugin checking if the problem disappears. In order to do so:
if (component.type === "link" && component.props && component.props.rel === "preload") { with if (component.type === "link" && component.props && component.props.rel === "preload" && !component.props.href.startsWith("/")) { and check if Gatsby reports the same error. Please let us know, thanks @styxlab 😊 |
Thanks for your suggestion, but I won't have time to follow up on this. I think the issue should be solved upstream - however, your plugin could serve as a transient solution after being enhanced. |
Don't you have the time to try the change I suggested? It's just a matter of a file change and a |
I can confirm that is not resolved this issue. After applying your suggested patch seems to don't get an expected result. I haven't noticed this issue on the localhost, faced it on production build, with the newest Google Chrome and Vercel. I have also using the |
I think the console warning is caused by crossorigin being empty and not set to anonymouse on a production build. This plugin is also not setting crossorigin to anyonymous because after using it the links still have crossorigin="". This plugin is not solving the issue. |
As reported on MDN
Could you check out if setting it to |
You are right mdn does say that but the thing is after using the plugin I still get the same error. What exactly does your plugin do? Can you add crossOrigin="use-credentials" instead to thos preload scripts with your plugin? |
I'm thinking about deprecating this module since it's more an annoyance than a help 😉 |
Done, I deprecated this package 😉 |
Thanks a lot for providing this plugin!
I'm using Lighthouse 6.1.0 from the command line (also tested it with LH 6.0.0 and chrome devtools) and cannot figure out how to get rid of multiple warnings of the form:
Note that I am using the
gatsby-plugin-preload-link-crossorigin
plugin. The plugin does add thecrossorigin
attribute to thepreload links
, but the warning remains. Looks like the gatsby-offline plugin kicks in, which I want to keep.Steps to reproduce
Clone the standard
gatby-starter-blog
, but withgatsby-plugin-preload-link-crossorigin
andgatsby-plugin-offline
added:Remove
preload-link-crossorigin
andoffline-plugin
This looks good, but I had to remove the
offline-plugin
which I need.Add the
preload-link-crossorigin
plugin again (offline plugin removed)Now the warning is appearing again, even without the offline plugin, so it looks like
gatsby-plugin-preload-link-crossorigin
is causing the issue instead of solving it.I hope you can give some insight as to why this plugin does not have the desired effects. Thanks for your time!
The text was updated successfully, but these errors were encountered: