Warning about preload not used because of script type mismatch #45
-
Is there any way to skip the preload tag generation? They just keep generating warnings in my app: A preload for 'http://ratel.arts.mun.ca:3000/vite-dev/admin/application.js' is found, but is not used because the script type does not match. Thanks for the gem! A |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Allan! Preload tags can be disabled by passing Rails generates early preload hints incorrectly for I made a pull request to Rails fixing this, and it has been merged, but I'm not sure whether fixes are backported. To disable that warning, you could:
|
Beta Was this translation helpful? Give feedback.
Hi Allan!
Preload tags can be disabled by passing
skip_preload_tags: true
to thevite_javascript_tag
helper. However, it seems like you are running into a different scenario.Rails generates early preload hints incorrectly for
type="module"
scripts (usesrel=preload
instead ofrel=modulepreload
).I made a pull request to Rails fixing this, and it has been merged, but I'm not sure whether fixes are backported.
To disable that warning, you could:
javascript_include_tag
manually to include the fix (not ideal)config.action_view.preload_links_header = false