Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught ReferenceError: regeneratorRuntime is not defined" error when calling any function #295

Open
adrianbunea opened this issue Jul 6, 2022 · 2 comments

Comments

@adrianbunea
Copy link

adrianbunea commented Jul 6, 2022

Expected Behavior

When I call toPng I expect to get the image and be able to process it.

Current Behavior

As soon as toPng is called I receive the error "regeneratorRuntime is not defined"

Possible Solution

I searched around everywhere, the consensus seems to be to install the regenerator and require it in your file where you call the function: https://dev.to/hulyakarakaya/how-to-fix-regeneratorruntime-is-not-defined-doj
This however results in the function crashing the browser after around 15 seconds or so. The error I get in chrome is error code 9 which by the looks of it is related to code compilation so probably the regenerator fix does not work.

Another thing I used on top of the one from the article above was to add a browserslist key in package.json by reading here: halfzebra/create-elm-app#597. This made it work once or twice but it more often than not crashes the browser with error code 9, especially for bigger HTML Nodes that take longer to process.

Steps To Reproduce

I use it in an Elm application. It is built using create-elm-app which uses Webpack and Babel under the hood. It seems to include the regenerator by default so I don't see why I get this error.

Can't really give precise steps on how to do this, just setup an elm app with create-elm-app and call the toPng function in index.js. Not sure if this happens in other frameworks.

Error Message & Stack Trace

toPng @ index.ts:111
generate @ index.js:135
(anonymous) @ VM810:1

Additional Context

Not sure if this is a problem with the framework/build tool I am using, or with the library honestly.

Your Environment

  • html-to-image: ^1.9.0
  • OS: PopOS 20.10
  • Browser: chrome 100.0.4896.88
@adrianbunea adrianbunea added the bug label Jul 6, 2022
@biiibooo
Copy link
Contributor

biiibooo bot commented Jul 6, 2022

👋 @adrianbunea

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@biiibooo
Copy link
Contributor

biiibooo bot commented Jul 27, 2022

Hiya!
This issue has gone quiet. Spooky quiet. 👻
We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

Thanks for being a part of the Antv community! 💪💯

@biiibooo biiibooo bot added the stale label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant