aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
606 stars 52 forks source link

React SWC 3.3.1 does not work #114

Closed aklinker1 closed 1 year ago

aklinker1 commented 1 year ago

If it can help future readers (I loose a few hours on this), upgrading @vitejs/plugin-react-swc from 3.2.0 to 3.3.1 broke the execution of the addons.

Popups are not rendered and in the console I get React refresh runtime was loaded twice. Maybe you forgot the base path? error.

Originally posted by @stevebeauge in https://github.com/aklinker1/vite-plugin-web-extension/discussions/113

aklinker1 commented 1 year ago

Works with the basic template, closing this issue.

pnpm create vite-plugin-web-extension --template react-ts
ben-xD commented 1 year ago

I have this issue too. Is there anything we can do to debug it?

aklinker1 commented 1 year ago

@ben-xD if you can share your project with me, I can debug it. If not, check your app's logs and network requests to see if there are any errors, failed network requests, or lack of logs compared to a plain website project.

Honsal commented 1 year ago

in my case

<script type="module" src="/src/pages/control-panel/index.tsx"></script> showing same error with this post.

but <script type="module" src="index.tsx"></script> works.

However HMR is not working on second version. Maybe related to #107