question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempted import error: 'event' is not exported from 'd3-selection'.

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Cggcommented, Feb 16, 2021

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?

0reactions
Cggcommented, Feb 16, 2021

Just updated my dependency and all is well, this can be closed.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found