GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

BUG: GrapesJS v0.21.5 Doesn't Work in NodeJS (Headless) #5389

Closed hannydevelop closed 1 year ago

hannydevelop commented 1 year ago

GrapesJS version

What browser are you using?

ChromeV117.0.5938.62

Reproducible demo link

https://stackblitz.com/edit/node-1zsusv

Describe the bug

How to reproduce the bug? Run node index.js to start application.

What is the expected behavior? ...

What is the current behavior?

node index.js
error TypeError: grapesjs.init is not a function
    at Object.eval (file:///home/projects/node-1zsusv/index.js:95:27)
    at Object.function (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:334:156846)
    at Module._compile (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:57:14311)
    at Module._extensions..js (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:57:14990)
    at Module.load (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:57:13006)
    at Module._load (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:57:9950)
    at Function.executeUserEntryPoint [as runMain] (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:168:693)
    at https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:298:142
    at 𝐰𝐜_0x126b (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:298:162)
    at _0x5c6800 (https://node1zsusv-qefh.w-credentialless.staticblitz.com/blitz.ef0c375a.js:329:41363)

If is necessary to execute some code in order to reproduce the bug, paste it here below:

const editor = grapesjs.init({ headless: true });

Code of Conduct

artf commented 1 year ago

Can you check with the latest version https://github.com/GrapesJS/grapesjs/releases/tag/v0.21.6

hannydevelop commented 1 year ago

Can you check with the latest version https://github.com/GrapesJS/grapesjs/releases/tag/v0.21.6

Thank you so much @artf this works perfectly.