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

Handle ExportAllDeclaration without node.exported #69

Open
dschnare opened this issue Apr 4, 2024 · 2 comments
Open

Handle ExportAllDeclaration without node.exported #69

dschnare opened this issue Apr 4, 2024 · 2 comments

Comments

@dschnare
Copy link

dschnare commented Apr 4, 2024

Expected Behavior

Given a module like:

export * from './other-file.mjs'

When IITM-ing this module I should get no errors when intercepting the import.

Actual Behavior

This error is thrown:

let $* = namespace.*
^
SyntaxError: Unexpected token '*'

This is because the ExportAllDeclaration case where node.exported is null is explicitly handled by pushing the exported name as "*".

Specifications

  • Version: 1.7.1
  • Platform: OSX
  • Subsystem: Node 18.19
@dschnare
Copy link
Author

dschnare commented Apr 4, 2024

This will be very tricky to solve for since you would need to recursively load the module source and call getEsmExports() at each level. And this would make loading all those modules slower I would assume since you're avoiding the import/require cache I think right?

@timfish
Copy link
Contributor

timfish commented Jun 28, 2024

Is this not fixed by v1.8.1?

There have been a lot of fixes in the last couple of releases around export * exports

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