Issue #5353šŸ’¬ AnsweredOpened Sep 1, 2023by rozek0 reactions

Canvas.script entries can not be JS modules

Quick answerby artf

Read full answer below ↓

Question

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 (Offizieller Build) (arm64)Reproducible demo link noneDescribe the bug links entered into can not refer to JavaScript modules, or you may run into the following error: This makes it really difficult to use modern JavaScript in combination with GrapesJSCode of Conduct[X] I agree to follow this project's Code of Conduct

Answers (3)

artf• Sep 3, 2023
scripts: [
  { src: '...file.js', type: 'module' },
],
rozek• Sep 3, 2023

good to know, thanks

GJS Helper• May 17, 2026

The issue you're encountering, "Uncaught SyntaxError: Cannot use import statement outside a module," arises because the canvas.scripts option in GrapesJS injects script URLs using standard <script> tags. By default, browsers treat these as classic scripts, which do not support ES module syntax (imp...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.