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
Breaks when using ??= syntax #32
Comments
Here is the diff that solved my problem: diff --git a/node_modules/vite-plugin-commonjs/dist/index.js b/node_modules/vite-plugin-commonjs/dist/index.js
index 9e8973b..73ebd5e 100644
--- a/node_modules/vite-plugin-commonjs/dist/index.js
+++ b/node_modules/vite-plugin-commonjs/dist/index.js
@@ -390,7 +390,7 @@ async function transformCommonjs({
return;
let ast;
try {
- ast = acorn.parse(code, { sourceType: "module", ecmaVersion: 2020 });
+ ast = acorn.parse(code, { sourceType: "module", ecmaVersion: "latest" });
} catch (error) {
return null;
}
diff --git a/node_modules/vite-plugin-commonjs/dist/index.mjs b/node_modules/vite-plugin-commonjs/dist/index.mjs
index faaa42a..586d5d0 100644
--- a/node_modules/vite-plugin-commonjs/dist/index.mjs
+++ b/node_modules/vite-plugin-commonjs/dist/index.mjs
@@ -388,7 +388,7 @@ async function transformCommonjs({
return;
let ast;
try {
- ast = parse(code, { sourceType: "module", ecmaVersion: 2020 });
+ ast = parse(code, { sourceType: "module", ecmaVersion: "latest" });
} catch (error) {
return null;
} This issue body was partially generated by patch-package. |
|
What's the reference to acorn@7? 🤔 It looks like you use acorn@8 which should work with "latest" right? vite-plugin-commonjs/package.json Line 29 in 647fe26
|
vs
I assume that something about this package breaks when using
??=
syntax?The text was updated successfully, but these errors were encountered: