BUG: canvas.script entries can not be JS modules
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
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
- I agree to follow this project's Code of Conduct
Answers (2)
scripts: [
{ src: '...file.js', type: 'module' },
],
good to know, thanks
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5354
BUG: canvas.script entries do not respect an "import map"
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Version 1.56.20 Chromium: 115.0.5790.171 (Of...
Issue #5352
BUG: Uncaught SyntaxError: Unexpected token '{' at CanvasView.ts:590:12
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 1.56.20 Chromium: 115.0.5790.171 (...
Issue #5363
BUG: cannot "sort" elements of layer panel
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Version 1.56.20 Chromium: 115.0.5790.171 (Of...
Issue #5362
BUG: draggable/droppable property functions not called while dragging
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 1.56.20 Chromium: 115.0.5790.171 (...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.