quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Vite: The resource at X preloaded with link preload was not used within a few seconds.

Open maggie44 opened this issue 3 years ago • 6 comments

What happened?

Since switching to Vite, I had been getting the following errors in FireFox browsers:

The resource at X preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly. - https://github.com/vitejs/vite/issues/4051

The fix is to use polyfillModulePreload: true:

https://github.com/vitejs/vite/issues/4051 https://github.com/vitejs/vite/pull/4058

Raises two questions. Quasar currently defaults to False, is that intended? (https://github.com/quasarframework/quasar/blob/4dc2bd3d30b6b3dbe7304f025db23b8a1117f4c5/docs/src/pages/quasar-cli-vite/browser-compatibility.md)

If it is intended, then the default quasar.config.js that is generated when creating a new project with Vite indicates that it is set to true by default, and should be changed to false.

Here is what I see in the default quasar.config.js. Obviously the line isn't enabled, but I had assumed the function was set to true by default because of the way it is shown:

// polyfillModulePreload: true,

What did you expect to happen?

polyfillModulePreload to be true, and if not to show that it is false by default in quasar.config.js

Reproduction URL

Not necessary.

How to reproduce?

N/A

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

maggie44 avatar Mar 20 '22 18:03 maggie44

Hi @maggie0002! 👋

It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

github-actions[bot] avatar Mar 20 '22 18:03 github-actions[bot]

I am also having this issue, not sure that a codepen should be needed in this case, it must happen to everyone using vite.

ssuess avatar Oct 19 '22 09:10 ssuess

@ssuess read the issue description:

The fix is to use polyfillModulePreload: true

https://quasar.dev/quasar-cli-vite/browser-compatibility

We'll investigate the issue and possibly implement the solutions about updating the template, docs, etc. as @maggie0002 suggested. Any user can solve this "issue" in their projects by enabling that option.

yusufkandemir avatar Oct 19 '22 12:10 yusufkandemir

@maggie0002

Here is what I see in the default quasar.config.js. Obviously the line isn't enabled, but I had assumed the function was set to true by default because of the way it is shown:

// polyfillModulePreload: true,

All commented lines about bool settings are structured in a way that you can uncomment them and they will work in the opposite of the default. Otherwise, they would be uncommented code with the actual default values.

yusufkandemir avatar Oct 19 '22 12:10 yusufkandemir

Thanks @yusufkandemir from reading it I assumed that true = preload everything, but it seems the opposite is true and indeed setting polyfillModulePreload: true removes those many messages, thanks.

ssuess avatar Oct 19 '22 13:10 ssuess

Thanks @yusufkandemir from reading it I assumed that true = preload everything, but it seems the opposite is true and indeed setting polyfillModulePreload: true removes those many messages, thanks.

polyfillModulePreload was changed to modulePreload.polyfill and the default is true and I still get the messages.

SomeoneIsWorking avatar Jul 19 '24 08:07 SomeoneIsWorking

Was this ever fixed? I see this warning about woff/eot font files in the browser in DEFAULT vite/vuetify 3 installation.

Shujee avatar Mar 07 '25 09:03 Shujee

@Shujee What's vuetify got to do with us?

rstoenescu avatar Mar 07 '25 10:03 rstoenescu