0

I am trying to import d3.js as follows

import * as d3 from "d3";

I have also tried the following way

const d3 = require('d3');

And I am getting the following error once the js script runs

Console Message

I am using parcel to build my project, and everything has worked fine until now. From some initial digging, this seems to be related to babel from looking at related posts.

Uncaught ReferenceError: regeneratorRuntime is not defined in react 17, webpack 5 while making api calls through actions

However, adding the suggested fixes to my package.json file under the babel options has not yielded any fixes so far...

Any thoughts?

Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
SirYansalot
  • 53
  • 1
  • 2
  • 5
  • See if this helps: https://flaviocopes.com/parcel-regeneratorruntime-not-defined/ – Shreshth Apr 12 '22 at 07:51
  • Can you share a reproduction of the issue (maybe on github)? One thing you might want to try/investigate: parcel recently switched to using SWC instead of Babel by default, because it's generally much faster. But it will still use babel if it finds babel configuration in the project. So one thing that might work (throwing spaghetti at the wall) is to remove babel config from your project, and see if SWC can do a better job. – Andrew Stegmaier Apr 13 '22 at 15:31
  • 1
    @Shreshth this post fixed my issue, thanks again for the help! – SirYansalot Apr 17 '22 at 23:40

0 Answers0