-
Notifications
You must be signed in to change notification settings - Fork 197
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
Will pay someone to fix this: Unable to import a .webm file #909
Comments
Alright i've put the sample as sample.web into the <video src={chrome.runtime.getURL('/assets/sample.webm')} /> into my Popup.tsx "@crxjs/vite-plugin": "^2.0.0-beta.23", my vite.config.ts: import { crx, defineManifest } from '@crxjs/vite-plugin';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
....
plugins: [
crx({ manifest: createManifest(env) }),
react(),
], aaaand it works in the 🟢production build but for some reason not in 🔴dev Why it does not work in dev? No idea, the response looks fine just the video does not load |
Working in dev is a hard requirement imo. |
@Toumash what will it take for this to get prioritized? More than happy to work something out. |
Its looks like a problem with Chrome's CSP but im not sure. No errors no nothing in the fetch() here
sendToServer .Only found this thread https://groups.google.com/a/chromium.org/g/chromium-extensions/c/xmg1ez0IxYU But. <video src={`https://github.com/Toumash/video-csp-test/raw/main/sample.webm`} controls></video> Works just fine |
If its a CSP problem sometimes the generated manifest web accessible resources / host permissions is different when in dev vs build. Try checking the generated manifest file to make sure you have permissions for the file. You might want to a specific manifest config for vite while in dev mode to give your self all the permissions and then change it up when building |
@cpakken prod manifest has even less configuration and yet it works. Service worker has it wrong somehow - theres a tip from a comment in the source code
|
@ryanmargono Just wondering if the bounty was still on for this before I take a crack at it. |
Build tool
Vite
Where do you see the problem?
Describe the bug
Not able to import a
.webm
file to use as a video source.Am able to import images to use as img sources.
Confirmed this is a plugin issue since i disabled it and ran dev in the browser as standlone vite react app.
When inspecting the popup with dev tools, the asset doesn't show (when hovering the src) while the images do.
Example:
^ This worked when using Plasmo. And this would be a blocker from us fully migrating to your tool.
Config:
Manifest:
Reproduction
N/A
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: