vite_ruby icon indicating copy to clipboard operation
vite_ruby copied to clipboard

Can't find SVG file in manifest after upgrade to 3.5.0

Open JasonBarnabe opened this issue 1 year ago • 0 comments

  • [x] I have tried upgrading by running bundle update vite_ruby.
  • [x] I have read the troubleshooting section before opening an issue.

Description 📖

After upgrading vite_ruby from 3.3.4 to 3.5.0, I'm getting an error while rendering pages: ActionView::Template::Error:"Vite Ruby can't find site/pages/cart/images/browser-redirect.svg in the manifests.. The generated flies at public/packs/vite/.vite/manifest.json and public/packs/vite/.vite/manifest-assets.json do not contain a reference to this file.

It should be included because:

  • vite.json includes app/components/**/*_controller.js under additionalEntrypoints.
  • app/components/payment_processor/stripe_fields_component_controller.js consists of import '~/site/pages/cart/images/browser-redirect.svg'
  • browser-redirect.svg is at app/javascript/site/pages/cart/images/browser-redirect.svg

On build, I see the message: Generated an empty chunk: "app/components/payment_processor/stripe_fields_component_controller.js"., however if I adjust the file to contain some actual JS and rebuild, I still get the error about the missing SVG.

This all worked on 3.3.4.

Reproduction 🐞

Repo is private, but I can provide some snippets or run debug commands if it's helpful.

Vite Ruby Info

Run bin/rake vite:info and provide the output:

bin/vite present?: true
vite_ruby: 3.5.0
vite_rails: 3.0.17
rails: 7.0.8
node: v20.11.0
npm: 10.2.4
yarn: 1.22.5
pnpm: 7.14.2
ruby: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

installed packages:
[email protected] /www/Simplero
├─┬ @vitejs/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]

JasonBarnabe avatar Jan 16 '24 20:01 JasonBarnabe