import-sync icon indicating copy to clipboard operation
import-sync copied to clipboard

ES2022 arbitrary module namespace identifiers cause error

Open wallzero opened this issue 9 months ago • 2 comments

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)

wallzero avatar Mar 20 '25 23:03 wallzero

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

  • https://github.com/httptoolkit/esm/issues

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

nktnet1 avatar Mar 20 '25 23:03 nktnet1

No problem!

Here: https://github.com/httptoolkit/esm/issues/5

Thanks!

wallzero avatar Mar 20 '25 23:03 wallzero