Closed aklinker1 closed 1 year ago
We can fix this by configuring the server.origin
to http://127.0.0.1:5173
, pointing to the dev server
@aklinker1 Hello, the error still exists, and I didn't set the vite root
to a custom directory.
Browsers:
Chrome: 117.0.5853.0 canary (x86_64)
npmPackages:
vite: 4.3.9
vite-plugin-web-extension: 3.0.9
If I modify the source code in node_modules
by changing origin: "http://127.0.0.1:5173"
to origin: "http://localhost:5173"
, the problem will be resolved.
And, the above modifications cannot take effect in vite.config.js. It seems that the server related configuration has been overwritten by this plugin.
@ccnnde Thanks for the report, I've updated the code to use localhost instead of 127.0.0.1. Not sure why I chose 127.0.0.1 for this originally... It just doesn't work on some computers.
See v3.0.10
Thank you for the quick fix.
Summary
When running dev mode with
vite dev
, images don't show up correctly in HTML files. Thesrc
attributes need to point tohttp://localhost:5137/path/to/image
, not just/path/to/image
. Without thelocalhost:5137
, it's looking for files from the root of the extension, not against the dev server which the URLs are formatted as.Environment