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

ESM build import/export are missing file extensions #22

Open
dmnsgn opened this issue Sep 6, 2021 · 1 comment
Open

ESM build import/export are missing file extensions #22

dmnsgn opened this issue Sep 6, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@dmnsgn
Copy link

dmnsgn commented Sep 6, 2021

For proper esm resolution, import/export file need to have a .js extension. Currently the esm index export the following:

export { default as filter } from "./filter";
export { default as flatMap } from "./flatMap";
export { default as interval } from "./interval";
export { default as map } from "./map";
export { default as merge } from "./merge";
export { default as multicast } from "./multicast";
export { default as Observable } from "./observable";
export { default as scan } from "./scan";
export { default as Subject } from "./subject";
export { default as unsubscribe } from "./unsubscribe";

which triggers an error when imported:

Module not found: Error: Can’t resolve ‘./symbols’ in ‘/path/to/node_modules/observable-fns/dist.esm’

This can be solved by adding .js to all the imports/export in the typescript source files (even if they're refering to .ts files).

@andywer
Copy link
Owner

andywer commented Sep 7, 2021

Hey @dmnsgn, thanks for sharing! Of course you're right…

Would you by any chance have time to prepare a PR?

@andywer andywer added the bug Something isn't working label Sep 7, 2021
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

2 participants