Open tembra opened 1 year ago
I was having the same problem on the beta version
There was an accidental import of
import { chromeExtension } from '@crxjs/vite-plugin';
in my jsx file which resulted in a similar error. I have removed the import and it started working.
Build tool
Vite
Where do you see the problem?
Describe the bug
I'm using
@crxjs/vite-plugin
and everything works well during development. I got no error withnpm run dev
. However if I try to build for production withnpm run build
I got the error.Digging deeper in the error (log below) I printed this information:
manifestJs
isundefined
but the line below try to access thecode
property of it raising the error:https://github.com/crxjs/chrome-extension-tools/blob/af2fdbc9e0715fa18418f473945624494243968e/packages/vite-plugin/src/node/plugin-manifest.ts#L255-L258
Here is also the
bundle
printed out:Reproduction
Repo: https://github.com/tembra/crxjs-vite-test
I basically follow the Get Started in 90 Seconds - React from the documentation
Logs
System Info
Severity
blocking an upgrade