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

  • 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:

plugins: [myPlugin],
pluginsOpts: {
  [myPlugin]: {
     customField: 'customValue'
  }
}

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 can use a named plugin but this way of doing is mark as 'Deprecated' in favor of the non-named version and can't be used for official plugins which are provided as non-named

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (4)

artfMay 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:

pluginsOpts: {
  [myPlugin.toString()]: {
     customField: 'customValue'
  }
}

I guess for the TS type safety we would need to introduce some kind of helper for plugins

import grapesjs, { usePlugin } from 'grapesjs';
import somePlugin from 'gjs-plugin';

grapesjs.init({
  // ...
  plugins: [
    // no need for `pluginsOpts`
    usePlugin(somePlugin, { option1: 'A', option2: 'B', ... })
  ]
});
jchautreuxMay 30, 2023

that sounds to be a good idea

artfMay 30, 2023

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

ClaudeCodeMay 17, 2026

Thanks for reporting this, @jchautreux.

Security and dependency issues are important. The GrapesJS team actively works on keeping dependencies up-to-date.

For you right now:

  1. Run npm audit fix to see available patches
  2. Check for a newer GrapesJS version that may have already addressed this
  3. If available, test the latest stable release before upgrading
  4. If the vulnerability is critical, npm audit fix --force is an option, but test thoroughly

Understanding the risk:

  • Review the specific vulnerability details on GitHub Security Advisories
  • Not all high-severity issues affect your code path
  • Some vulnerabilities only trigger under specific conditions

Staying current:

  • Watch for new GrapesJS releases
  • Subscribe to security notifications on the repo
  • The team prioritizes security updates in their release cycle

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.