Issue #5354💬 AnsweredOpened Sep 1, 2023by rozek0 reactions

Canvas.script entries do not respect an "import map"

Quick answerby artf

https://github.com/GrapesJS/grapesjs/issues/5353#issuecomment-1704023749

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 scripts referenced by canvas.scripts can not import third-party modules based on an "import map". if the same module has to be used both by editor, preview and HTML export it may require the preparation of two different script versions - one for development (within GrapesJS) and another one for deployment - which should definitely be avoidedCode of Conduct[X] I agree to follow this project...

Answers (4)

rozekSep 4, 2023

have you tested them? when trying in the current version of GrapesJS, I get the following (expanded) error message in the browser log:

rozekSep 4, 2023

trying to use a data URI instead of a file reference failed as well

GJS HelperMay 17, 2026

The issue you're encountering stems from the isolated nature of the GrapesJS canvas, which is typically rendered within an <iframe>. Import maps, defined using <script type="importmap">, are scoped to the document they are declared in. When GrapesJS loads scripts via canvas.scripts, these scripts a...

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.