diff --git a/.changeset/many-beans-perform.md b/.changeset/many-beans-perform.md new file mode 100644 index 0000000..4b1ccc9 --- /dev/null +++ b/.changeset/many-beans-perform.md @@ -0,0 +1,5 @@ +--- +"@marko/vite": patch +--- + +Ignore errors caused by cjs => esm conversion diff --git a/src/index.ts b/src/index.ts index 1393a6e..958bd72 100644 --- a/src/index.ts +++ b/src/index.ts @@ -634,7 +634,11 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] { if (!isBuild) { const ext = path.extname(id); if (ext === ".cjs" || (ext === ".js" && isCJSModule(id))) { - return cjsToEsm(source); + try { + return await cjsToEsm(source); + } catch { + return null; + } } }