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

Duplicate exports from the same source file are incorrectly excluded #171

Open
timfish opened this issue Dec 13, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@timfish
Copy link
Contributor

timfish commented Dec 13, 2024

If a module has multiple exports with the same name, these do not get exported. However, if duplicate named exports come from the same source file, it should be retained.

A simple example:
a.mjs

export const val = 1;

b.mjs

export * from './a.mjs';

c.mjs

export * from './a.mjs';
export * from './b.mjs';

When run in Node, c.mjs has a single export named val.
When running through import-in-the-middle there is no export.

This issues currently affects for the following libraries:

  • svelte
  • drizzle-orm

Using these libraries when they have been wrapped by import-in-the-middle results in errors like:

  • ReferenceError: X is not defined
  • The requested module 'M' does not provide an export named 'X'
@timfish timfish added the bug Something isn't working label Dec 13, 2024
@timfish timfish pinned this issue Dec 13, 2024
@timfish timfish unpinned this issue Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant