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
I verified that navigating the correct path returns the module source as expected.
The prefix_asset_with_host method at vite_ruby/manifest.rb#L144 appears to be the issue at first glance. I might be able to use the assetHost setting, but setting it to /sub broke the other imports. Configuring the entire host URL would work, but it is undesirable.
Could config.base be included in this join as well? If desired, I could submit a PR with a test case.
The text was updated successfully, but these errors were encountered:
Can you confirm if the following patch fixes the issue in your scenario:
ViteRuby::Manifest.prependModule.new{# Internal: Prefixes an asset with the `asset_host` for tags that do not use# the framework tag helpers.defprefix_asset_with_host(path)File.join(vite_asset_origin || config.asset_host || "/",config.base,config.public_output_dir,path)end}
Description 📖
The script module appended by the
vite_react_refresh_tag
does not consider the base setting in the react preamble code.Reproduction 🐞
config/environments/development.rb
config.ru
config/vite.json
/sub
path loaded in the browser.The appended module script will look something like so:
This leads to a 404 error on the import. The correct import path should be.
I verified that navigating the correct path returns the module source as expected.
The
prefix_asset_with_host
method at vite_ruby/manifest.rb#L144 appears to be the issue at first glance. I might be able to use theassetHost
setting, but setting it to/sub
broke the other imports. Configuring the entire host URL would work, but it is undesirable.Could
config.base
be included in this join as well? If desired, I could submit a PR with a test case.The text was updated successfully, but these errors were encountered: