-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
GrapesJS version
- I confirm to use the latest version of GrapesJS
GrapesJS MJML version
- I confirm to use the latest version of GrapesJS MJML
What browser are you using?
Not applicable (it's running on a server)
Reproducible demo link
https://codesandbox.io/p/sandbox/m86rgn
Describe the bug
How to reproduce the bug?
- Init GrapeJS in headless mode
- Try to run command mjml-code-to-html
What is the expected behavior?
The html is created (and does not rely on window since we run it in headless mode).
What is the current behavior?
We have this error :
window is not defined
ReferenceError: window is not defined
at Object.moduleId [as 480] ...
If is necessary to execute some code in order to reproduce the bug, paste it here below:
const editor = grapesjs.init({
telemetry: false,
headless: true,
plugins: [usePlugin(grapesJSMJML, { useCustomTheme: false })],
projectData: {"test": "test"} as ObjectAny,
});
console.log(emailEditor.runCommand('mjml-code-to-html').html.toString());
Workaround:
We found a solution by importing global-jsdom/register, that gives a mock of window.
Code of Conduct
- I agree to follow this project's Code of Conduct
gbremond, chloe-moreau and tugaysahin61
Metadata
Metadata
Assignees
Labels
No labels