Open NeoExtended opened 2 years ago
@NeoExtended thanks for reaching out.
Indeed this issue typically occurs when you have more than one instance of d3-selection
in your entire dependency tree.
If you look inside your package-lock.json
can you look for d3-selection
and see how many instances do you have (and for which versions)?
You can also try to run npm update
, or even (temporarily) remove package-lock.json
and re-install from scratch to see if the issue remains or gets solved.
@vasturiano Thanks for your reply.
If i look into my package-lock.json
, i can find two entries for d3-selection
, but i think they point to the same version (i am using npm version 8.1.3
and with lockfileVersion 2
i think this is expected behaviour):
"node_modules/d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"engines": {
"node": ">=12"
}
},
and
"d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ=="
},
A lot of packages have d3-selection in their dependencies, but they all accept version 3.
I have also tried to delete my package-lock.json
and node_modules
folder and even tried to completly reinstall npm, but neither worked. :(
If it makes it easier, i can upload my entire package.json
and/or package-lock.json
somewhere.
@NeoExtended the fact that you have two entries for d3-selection
, even if it's the same version, it's most likely the core reason for your issue.
Perhaps you can try deduplicating your dependency tree. I know that with yarn
you can do that with dedupe, maybe there's an npm equivalent.
You can also reach out to the maintainers of d3-selection
for more dedicated help, since it's more relevant to that repo than this one at this point.
Hey @vasturiano, first of all thank you again for your help. I investigated further and found, that the problem seems to not be related to my installed packages, but to my building process.
Somehow parcel
fails to include the file d3-transition/src/selection/interrupt.js
and therefore the function is not available for d3-zoom
. Disabling scope-hoisting via the --no-scope-hoist
flag resolves the problem (but leads to larger file sizes). I will reach out to the maintainers of parcel
and report the problem.
Thank you for reporting back on findings @NeoExtended. That's useful to know for future cases.
Describe the bug After building my project with parcel i receive an error from d3-zoom line 91 that selection.interrupt() is not a function. I am not sure if this is error is related to this project or to the d3-zoom project.
I found multiple resources telling me this might be the cause of a d3-selection version conflict, but i double-checked and i only have a single version of d3-selection installed and d3-zoom has version 3.0.
Going into the node_modules folder and editing line 91 of d3-zoom (removing the .interrupt()-call) fiexes the problem, but i am not sure if that is the correct "fix" in this case.
Any help is highly appreciated.
My package.json deps looks like this:
From my package-lock.json:
Desktop (please complete the following information):