Skip to content
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

tokTypes of acorn-jsx will be different TokenType classes if acorn itself is loaded via ESM #133

Open
JounQin opened this issue Mar 28, 2022 · 0 comments

Comments

@JounQin
Copy link

JounQin commented Mar 28, 2022

acorn-jsx/index.js

Lines 85 to 91 in de5b1e9

Object.defineProperty(module.exports, "tokTypes", {
get: function get_tokTypes() {
return getJsxTokens(require("acorn")).tokTypes;
},
configurable: true,
enumerable: true
});

acorn can be loaded as ESM: https://github.com/acornjs/acorn/blob/master/acorn/package.json#L11

But the above codes enforces to load cjs version of acorn, it will cause the problem described as title.

related #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant