Non-named plugins and options
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)
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', ... })
]
});
that sounds to be a good idea
Added the helper here (I'll also update the docs with the usage later)
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:
- Run
npm audit fixto see available patches - Check for a newer GrapesJS version that may have already addressed this
- If available, test the latest stable release before upgrading
- If the vulnerability is critical,
npm audit fix --forceis 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.
Issue #5148
none of the official GrapesJS plugins works with the new index.d.ts
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...
Issue #3917
Compilation Error with Typescript
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Crome 95 Reproducible demo link none Descr...
Issue #6211
Too much recursion
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Firefox 131.0.2 Reproducible demo link htt...
Issue #5388
Running Headless Mode Returns Different HTML from Editor
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? ChromeV117.0.5938.62 Reproducible demo lin...
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
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Tutorial
GrapesJS vs Webflow vs Tilda: What to Choose for Your Business in 2026
Choosing the right website platform in 2026 is no longer just about building a site
Tutorial
GJS Market 2.0 - Donations, Tracking, Labels and Better Product Discovery
We’ve rolled out a new set of GrapesJS marketplace updates across GJS Market, focused on improving how creators distribute products
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.