-
Notifications
You must be signed in to change notification settings - Fork 138
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
Issues with vite dev server #23
Comments
Steps to replicate this fix: Ensure you have these in your package.json scripts: Ensure you have a key-value pair for the preview in your vite.config.ts: Open terminal in your src folder and run Now the project will be built on save, in my case, I have to reload the page as well after each build. |
I have this problem also |
@TomYeoman |
Thanks for the info @kvndrsslr, may do this just to get development flow working. I'm using https://crxjs.dev/vite-plugin for extension development, and running in watch mode doesn't work at all for content scripts. |
Yes, this is definitely a Vite dev server problem. Running the same exact code in a fresh create-react-app typescript template project worked just fine. |
@kvndrsslr - I was experiencing the same issue in vitejs, I implemented a workaround by installing the required dependency lamejs and imported that into my component without using it. const { Mp3Encoder } = await import('lamejs'); or import { Mp3Encoder } from 'lamejs'; Not sure about the issue with Vitejs or lamejs. |
Thank you for your reply. It literally saved my day! |
So I tried to get this component to work for a couple hours now, finally realized that vite (in a fresh project initialized with
pnpm create vite
) dev server does in fact not play well with it.Have not yet figured out what exactly is stopping it from working, but wanna leave this issue here in the meantime so others are aware.
If you're using vite, the awkward but possible workaround is to
vite build --watch
andvite preview
, then this component will work as expected.The text was updated successfully, but these errors were encountered: