Closed jcsofts closed 4 years ago
As per the documentation, you have to install grapesjs as a peer dependency:
npm i grapesjs --no-save
Did you do that?
yeah, I do that.
I download the source to my project and remove comment out the first line of grapesjs-blocks-bootstrap4/src/index.js
change //import grapesjs from 'grapesjs';
to import grapesjs from 'grapesjs';
then it works
Do you have any steps to repro this? It would be good to know also what versions of: OS, Node, NPM, Yarn, browser, etc.
Hi!
I have a similar issue. In this case I'm working with a major grapesjs project, so I really dont want to take this plugin as a standalone but import this plugin into the main project.
So, I have cloned the original GrapesJS repo, then did npm i grapesjs-blocks-bootstrap4
and tried to do import pluginBootstrap4 from 'grapesjs-blocks-bootstrap4'
but it says that cannot find grapesjs.
I uncommented the import grapesjs line, and also re-installed the grapesjs via npm i grapesjs --no-save
(which doesnt have too much sense for me as I'm already working inside grapejs) ...
Please, I'm really lost
Ok, I see what you mean @jcsofts @sircoko , I've updated the plugin to 0.2.3, can you see if this fixes the issue.
Ok I checked, reinstalled the node_modules and package lock.
It could be me doing something wrong..
@kaoz70 would you tell me about the steps I should follow in order to embed this plugin into a grapesjs project?
Just to be suer.
Thanks
@sircoko please check this link out for a simple implementation: https://codesandbox.io/s/sad-villani-w2w8l?file=/src/index.js
@kaoz70 thanks, the bug fixed
Great! Then I'm closing this issue.
get this error when I use it with webpack
` import GrapesJS from 'grapesjs'; import pluginBootstrap4 from 'grapesjs-blocks-bootstrap4 GrapesJS.init({ ... plugins: [ pluginBootstrap4], ... })
`
and got below error when run it grapesjs-blocks-bootstrap4.min.js:11 Uncaught ReferenceError: grapesjs is not defined