-
Notifications
You must be signed in to change notification settings - Fork 124
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
An import map is added after module script load was triggered
in console.
#417
Comments
<!DOCTYPE html>
<html>
<head>
<title>ViteRailsReport</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<%= vite_client_tag %>
<%= vite_javascript_tag 'application' %>
<!--
If using a TypeScript entrypoint file:
vite_typescript_tag 'application'
If using a .jsx or .tsx entrypoint, add the extension:
vite_javascript_tag 'application.jsx'
Visit the guide for more information: https://vite-ruby.netlify.app/guide/rails
-->
</head>
<body>
<%= yield %>
</body>
</html> If I remove the |
Any news? |
Having same issue on 7.1 |
This happens because when you include scripts from helpers like When using importmaps, if you're also preloading a module script through the link header (or I'd assume even the link tag if you use it above the importmap definition) is not supported. To "fix" (taking some perf hit), you can use the option <%= vite_client_tag(preload_links_header: false) %>
<%= vite_javascript_tag('application', media: 'all', data: { turbolinks_track: true, turbo_track: 'reload' }, preload_links_header: false) %> |
https://vite-ruby.netlify.app/guide/troubleshooting.html# config/environments/development.rb
Rails.application.configure do
# Disable `Link: ... rel=preload` header to workaround Safari caching bug
# https://bugs.webkit.org/show_bug.cgi?id=193533
config.action_view.preload_links_header = false
end |
BackgroundI am using Ruby on Rails version 7.2 I keep seeing error messages in Chrome Console
This solves the problem# config/environments/development.rb
Rails.application.configure do
# Disable `Link: ... rel=preload` header to workaround Safari caching bug
# https://bugs.webkit.org/show_bug.cgi?id=193533
config.action_view.preload_links_header = false
end |
bundle update vite_ruby
.Description 📖
The following error message appears in the browser console.
Reproduction 🐞
Please provide a link to a repo that can reproduce the problem you ran into.
https://github.com/gomo/vite_rails_report
I did this.
I wrote
gem vite_rails
in my Gemfile.Open
http://localhost:3000/vite/index
in your browser.Vite Ruby Info
Run
bin/rake vite:info
and provide the output:Logs 📜
If not providing a reproduction:
Output
Run
DEBUG=vite-plugin-ruby:* bin/vite dev
orDEBUG=vite-plugin-ruby:* bin/vite build
and provide the output:Screenshots 📷
Provide console or browser screenshots of the problem.
The text was updated successfully, but these errors were encountered: