-
Notifications
You must be signed in to change notification settings - Fork 962
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
mjml2html
render in web worker throws Uncaught ReferenceError: window is not defined
#2853
Comments
As you mentioned The way the This would likely require a |
If we remove the window binding (which the So, I’m not sure if a separate package is required, as long as we modify the generic amd style export in some way:
|
I think that would fix Deno as well, which reports (as of Deno v2):
|
I'lll see what I can do when I'll finish #2908 |
Describe the bug
In a web worker:
To Reproduce
Steps to reproduce the behavior:
import mjml2html from "mjml-browser";
Expected behavior
I expect
mjml-browser
to work in web workers, without throwing any errors. It’s a cpu heavy process that would be perfect for web workersMJML environment (please complete the following information):
mjml-browser
Email sending environment(for rendering issues):
N/A
Affected email clients (for rendering issues):
N/A
Screenshots
N/A
Additional context
window
is not a global variable in web workers https://stackoverflow.com/a/11237259The text was updated successfully, but these errors were encountered: