Attempted import error: 'event' is not exported from 'd3-selection'.
See original GitHub issueI’m trying to use this with Next.js, and when I import it using import render from "d3-render"
I get this error:
./node_modules/d3-render/dist/d3-render.esm.js
Attempted import error: 'event' is not exported from 'd3-selection'.
I looked at d3-selection
in my node-modules
and it looks like event
is no longer exported from it.
For now, I just remove event
from import { select, namespace, event, selection } from 'd3-selection'
in d3-render/dist/d3-render.esm.js
, and it works (but obviously without whatever events
did).
I don’t really need events right now for my use case. I also want to say thank you for this module and your great tutorial on your bubble chart!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Attempted import error: 'behavior' is not exported from 'd3'
Attempted import error : 'behavior' is not exported from 'd3' (imported as 'd3'). SankeyComponent.js This is my code for creating SankeyComponent ...
Read more >"attempted import error: 'event' is not exported from 'd3 ...
D3 doesn't recognize the event. I get this message: "attempted import error: 'event' is not exported from 'd3' (imported as 'd3'.
Read more >Attempted import error 'X' is not exported from | bobbyhadz
The React.js "Attempted import error 'X' is not exported from" occurs when we try to import a named import that is not present...
Read more >Attempted import error: 'behavior' is not exported from 'd3'
Coding example for the question Attempted import error: 'behavior' is not exported from 'd3'-Reactjs.
Read more >d3-selection - npm
Data-driven DOM manipulation: select elements and join them to data.. Latest version: 3.0.0, last published: 2 years ago.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve opened #13 which fixes this issue by updating the D3 dependency to ^6.
If the desire is to stick with v5 I am happy to submit another PR instead to restrict the peer deps versions.
@unkleho thoughts?
Just updated my dependency and all is well, this can be closed.