-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed as not planned
Closed as not planned
Copy link
Labels
wrong repoIssues that should be opened in another repository.Issues that should be opened in another repository.
Description
Version
v22.9.0
Platform
Darwin Mac-mini.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:36:26 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8103 arm64
Subsystem
No response
What steps will reproduce the bug?
related repo https://github.com/Callidon/bloom-filters
When I added this bloom-filters CJS package to my ESM project, I could not import the named functions of this package by name, and could only use the default import.
steps for reproduction:
- this is reproduction code: bloom-filters.zip
- Enter the
demo_test
directory and executeyarn
to install dependencies. At this time,bloom-filters
is pulled in bynpm
. - When you run
node index.js
, you'll notice that all the named functions exported by the package are located on the default object except for the MinHash method.

- Now, let's import the bloom-filter as a file protocol.

-
As shown in the figure above, all named functions in
bloom-filter
have appeared on the module object and default object.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
My expectation is that the bloom-filter
pulled from npm can also import named functions.
Just like what is said in the document https://nodejs.org/docs/latest-v22.x/api/esm.html#commonjs-namespaces
What do you see instead?
As I have described.
Additional information
No response
Metadata
Metadata
Assignees
Labels
wrong repoIssues that should be opened in another repository.Issues that should be opened in another repository.