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

callbag-flatten exports default #21

Open
jorbuedo opened this issue Oct 5, 2018 · 2 comments
Open

callbag-flatten exports default #21

jorbuedo opened this issue Oct 5, 2018 · 2 comments

Comments

@jorbuedo
Copy link

jorbuedo commented Oct 5, 2018

Following the build it yourself philosophy of this library, I made my own lib of callbags.
Just a package.json with the dependencies I need and an index.js exporting them like the one in this project.

However I noticed callbag-flatten failed to work, because the new version doesn't export the function like the rest of the callbags. Now it needs to be
flatten: require('callbag-flatten').default,
instead of the previous
flatten: require('callbag-flatten')

I wonder, shouldn't all calbags export the same way?

@staltz
Copy link
Owner

staltz commented Oct 10, 2018

It should

@niieani
Copy link

niieani commented Nov 15, 2021

Confirming this is an issue. callbag-flatten is not CommonJS but a module, which means the correct export is, as @jorbuedo pointed out, called default.
Importing flatten from the current version of callbag-basics results in importing a module, rather than the function.

Webpack behaves closer to spec and fails, but when compiled with esbuild this works. So your milage may vary. But it should be corrected, either here, or upstream in callbag-flatten.

Recommended workaround is to use callbag-flatten installed directly.

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

3 participants