Jervis2049 / vite-plugin-crx-mv3

Build a Chrome Extension with Vite⚡
201 stars 30 forks source link

Failed to load config (The requested module 'acorn' does not provide an export named 'default') #32

Closed stephenhandley closed 11 months ago

stephenhandley commented 11 months ago

Hi I'm running into the following issue using yarn 3.6.3. I'm using workspaces in yarn not sure if that could be causing part of the issues?

failed to load config from /my_project/extension/vite.config.ts
error during build:
file:///my_project/node_modules/vite-plugin-crx-mv3/dist/index.mjs:16
import acorn from "acorn";
       ^^^^^
SyntaxError: The requested module 'acorn' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadConfigFromBundledFile (file:///my_project/node_modules/vite/dist/node/chunks/dep-df561101.js:66235:21)
    at async loadConfigFromFile (file:///my_project/node_modules/vite/dist/node/chunks/dep-df561101.js:66086:28)
    at async resolveConfig (file:///my_project/node_modules/vite/dist/node/chunks/dep-df561101.js:65682:28)
    at async build (file:///my_project/node_modules/vite/dist/node/chunks/dep-df561101.js:47852:20)
    at async CAC.<anonymous> (file:///my_project/node_modules/vite/dist/node/cli.js:822:9)
stephenhandley commented 11 months ago

The issue was that i had "type": "module" in my package.json