Issue #5149๐Ÿ’ฌ AnsweredOpened May 29, 2023by jchautreux0 reactions

Non-named plugins and options

Quick answerby artf

This seems to be related to https://github.com/microsoft/TypeScript/issues/35945 As a workaround you could do something like this for now: I guess for the TS type safety we would need to introduce some kind of helper for plugins

Read full answer below โ†“

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? all and none, the bug is during the build Reproducible demo link unnecessary Describe the bug How to reproduce the bug? Use NPM to install GrapesJS to use it in a typescript project. According to the documentation, to set options of an non-named plugin, we have to defined this in init: What is the expected behavior? The build of the project works What is the current behavior? The build failed with this error: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. FYI We c...

Answers (4)

artfโ€ข May 30, 2023

This seems to be related to https://github.com/microsoft/TypeScript/issues/35945 As a workaround you could do something like this for now: I guess for the TS type safety we would need to introduce some kind of helper for plugins

jchautreuxโ€ข May 30, 2023

that sounds to be a good idea

artfโ€ข May 30, 2023

Added the helper here (I'll also update the docs with the usage later)

GJS Helperโ€ข May 17, 2026

The issue you're encountering with your TypeScript build failing when trying to pass options to a non-named GrapesJS plugin is due to TypeScript's strict type checking for computed property names in object literals. While JavaScript implicitly converts a function object to its string representation...

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.