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.

ivy: d3-scale not transpile correctly

See original GitHub issue

Describe the bug One of the dependency of ngx-charts, d3-scale throw error at line 23

const is not initialised 

To Reproduce Steps to reproduce the behavior:

  1. update to angular version 9
  2. Test on IE 11

Expected behavior Should able to transpile correctly

ngx-charts version 13.0.2

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

7reactions
iiceman40commented, Mar 5, 2020

We had the same problem. While targeting ES2015 and letting differential loading take care of generating the ES bundles in production works fine we could not run and test the application locally with ng serve anymore. For ng serve we have to explicitly target ES5 to be able to debug the application in IE11.

We solved this for now by declaring “resolutions” in our package.json. This way we can downgrade d3-scale (to 2.x) and d3-array (to 1.x) - similar to what @shahmirn did - but without having to create a manuell build.

package.json

...
"resolutions": {
  "d3-scale": "^2.x",
  "d3-array": "^1.x"
},
...
2reactions
petebacondarwincommented, Feb 13, 2020

I believe that works because it tells the CLI to check the module property before the main property since it is compiling ES2015 rather than ES5. I might have made a mistake in my configuration above since I wrote it off the top of my head and haven’t checked it directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

D3's scale not working properly - Stack Overflow
The issue is that your input and output ranges are mirrored -- that is, the largest input value maps to the smallest output...
Read more >
How can D3 be successfully used in a React.js framework ...
You'll have to decide which of the two is responsible for manipulating the DOM. If it's React: then React will create, remove and...
Read more >
Continuous scales / D3 - Observable
These scales are typically useful when one needs to match a domain to a surface area instead of a length, or when the...
Read more >
How to Set Up D3.js with Webpack and Babel - Code Like A Girl
Your app should start running. Check in your browser to make sure everything is working correctly. Step 7: Install D3. Run npm install...
Read more >
d3 - npm
D3 (or D3.js) is a JavaScript library for visualizing data using web standards. D3 helps you bring data to life using SVG, Canvas...
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