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: canvas.script entries can not be JS modules #5353

Closed rozek closed 1 year ago

rozek commented 1 year ago

GrapesJS version

What browser are you using?

Version 1.56.20 Chromium: 115.0.5790.171 (Offizieller Build) (arm64)

Reproducible demo link

none

Describe the bug

links entered into

    let Editor = grapesjs.init({
      canvas: {
        scripts:[...],
        ...

can not refer to JavaScript modules, or you may run into the following error:

Uncaught SyntaxError: Cannot use import statement outside a module

This makes it really difficult to use modern JavaScript in combination with GrapesJS

Code of Conduct

artf commented 1 year ago
scripts: [
  { src: '...file.js', type: 'module' },
],
rozek commented 1 year ago

good to know, thanks