GrapesJS / components-custom-code

GrapesJS component for the embed of custom code
https://grapesjs.com/demo.html
BSD 3-Clause "New" or "Revised" License
74 stars 45 forks source link

Plugin fails to load with no setter error #21

Closed TheDude70 closed 2 years ago

TheDude70 commented 2 years ago

adding this plugin to Grapesjs causes the editor to fail loading with console error: Cannot set property defaults of #<n> which has only a getter

We're running Grapejs in a Vue component, but even declaring the editor outside of Vue results in same issue.

Have also tried both ways to import the plugin with same result.

Currently am running 0.20.1 as the Grapesjs version

artf commented 2 years ago

I see no issues with this plugin as it's used also on the official demo. The latest version of grapesjs https://github.com/artf/grapesjs/releases/tag/v0.20.1 introduces a change which might generate that error if there is an usage of the legacy API for custom components (which is not a case of this plugin). Ensure you're not using that legacy API in your custom components or maybe some other plugin.

A reproducible demo might be helpful in such a case.

TheDude70 commented 2 years ago

@artf I removed the plugin and reinstalled it and now it is working. Apparently something did not work right with update from 0.1.3 to 1.0.1, so blame it on npm 😛

davenene commented 1 year ago

I am facing the same error. How exactly do I remove legacy api? coz apparently I am unable to 'npm run build' and regenerate the min files for custom code. There are some errors in this source code @artf @TheDude70