3.0.0: RenderContext2D type is lost through babel
See original GitHub issueI’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:
- Created 4 years ago
- Comments:13 (4 by maintainers)
Top 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 >
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
got it 👍 i’ll also update the
CHANGELOG
with all the PRs we pushed right before we publish 3.0.0 officially@dangreen yup, thanks so much!