Issue #5353Opened September 1, 2023by rozek0 reactions

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)

artfSeptember 3, 20230 reactions
scripts: [
  { src: '...file.js', type: 'module' },
],
rozekSeptember 3, 20230 reactions

good to know, thanks

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.