Skip to content

ES2022 arbitrary module namespace identifiers cause error #139

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

Open
wallzero opened this issue Mar 20, 2025 · 2 comments
Open

ES2022 arbitrary module namespace identifiers cause error #139

wallzero opened this issue Mar 20, 2025 · 2 comments

Comments

@wallzero
Copy link

Exports with a string such as:

export { index as default, index as "module.exports" };

cause error:

Require error message:
        ./node_modules/@stylistic/eslint-plugin/dist/index.js:108
      export { index as default, index as "module.exports" };
                                          ^
      
      SyntaxError: Invalid or unexpected token

Some discussion around adding module.exports named export for require(esm)

@nktnet1
Copy link
Owner

nktnet1 commented Mar 20, 2025

Thanks @wallzero - are you able to also create an issue for this here:

import-sync uses @httptoolkit/esm under the hood.

@wallzero
Copy link
Author

No problem!

Here: httptoolkit/esm#5

Thanks!

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

2 participants