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.

3.0.0: RenderContext2D type is lost through babel

See original GitHub issue

I’m trying to use 3.0.0 in a project, and its fixed an issue I had with 2.0, so thats great! But there are a few weird things. The first is a type error when trying to use it server-side:

node_modules/canvg/lib/Transform/types.d.ts:5:18 - error TS2304: Cannot find name 'RenderingContext2D'.

5     unapply(ctx: RenderingContext2D): void;
                   ~~~~~~~~~~~~~~~~~~

(and a bunch more)

it seems that the globals.d.ts file isn’t included in the generated lib directory. In general I’m using canvg server side and client side - I would really prefer if you could just use something like tsc to turn the code to modern JS, and let users take care of e.g. async transforms and other rollup/webpack features to support older browsers. (a separate issue took a while to track down because the async transform made it hard to figure out what was throwing).

Overall this is super work tho!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gabelernercommented, Nov 6, 2019

got it 👍 i’ll also update the CHANGELOG with all the PRs we pushed right before we publish 3.0.0 officially

0reactions
bpowerscommented, Nov 9, 2019

@dangreen yup, thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript SVG parser and renderer on Canvas - canvg
3.0.0 : RenderContext2D type is lost through babel. I'm trying to use 3.0.0 in a project, and its fixed an issue I had...
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