You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using vite_client_tag, I'm seeing the following in my browser's console:
The resource http://localhost:3001/vite-dev/@vite/client 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.
I can't share too much in the way of logs or any other details because of the nature of project, but I can share that adding defer: true to the helper fixes the issue:
It's likely that you are running in an environment where early response hints are enabled, and Rails is sending a header to let the browser preload the script.
The mismatch is probably related to the fact that the client script is a module, and you are running in an old Rails version that sends hints incorrectly for module scripts.
I deleted my previous comments. You're right. After taking a closer look it seems my version of Rails does not include your patch to the javascript_include_tag helper.
bundle update vite_ruby
.Description 📖
Using
vite_client_tag
, I'm seeing the following in my browser's console:I can't share too much in the way of logs or any other details because of the nature of project, but I can share that adding
defer: true
to the helper fixes the issue:Example:
I believe
defer: true
is the correct option here, though not 100% familiar with how HMR is processed in Vite.If this is an issue anyone else is having, I'd be happy to add a PR for it. Otherwise, just use this report as point of reference.
The text was updated successfully, but these errors were encountered: