Canvas.script entries do not respect an "import map"
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)
have you tested them? when trying in the current version of GrapesJS, I get the following (expanded) error message in the browser log:
trying to use a data URI instead of a file reference failed as well
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.
Issue #5353
Canvas.script entries can not be JS modules
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
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
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
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...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.
Tutorial
Ship to Production Faster: What’s New in GrapesJS Shadcn
Supercharge your page builder! GrapesJS Shadcn adds live drag previews, rich text / commands, dynamic data, and canvas presets to ship to prod faster.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.