Closed anuragk15 closed 3 years ago
I tried importing this library on Nextjs first and failed(despite dynamic loading etc). Thought its a problem with Nextjs config or something and therefore moved to React. Same problem on React too.
import 'grapesjs-preset-webpage'; import {Editor} from 'grapesjs-react' import 'grapesjs/dist/css/grapes.min.css'; const Primary = () => { return <Editor id='grapesjs-react' plugins={[ 'gjs-blocks-basic' ]} />; }; export default Primary;
This is the error I get: Attempted import error: 'grapesjs-react' does not contain a default export (imported as 'Editor').
Tried using import Editor from 'grapesjs-react' and import {GEditor} from 'grapesjs-react' as well.
Not working in both React and Nextjs.
Here are the dependencies of React: "dependencies": { "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "grapesjs": "^0.17.19", "grapesjs-preset-webpage": "^0.1.11", "grapesjs-react": "^4.0.1-alpha", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "4.0.3", "web-vitals": "^1.1.2" },
Silly error. Was using wrong named import. It should be {GrapesjsReact}
I tried importing this library on Nextjs first and failed(despite dynamic loading etc). Thought its a problem with Nextjs config or something and therefore moved to React. Same problem on React too.
This is the error I get: Attempted import error: 'grapesjs-react' does not contain a default export (imported as 'Editor').
Tried using import Editor from 'grapesjs-react' and import {GEditor} from 'grapesjs-react' as well.
Not working in both React and Nextjs.
Here are the dependencies of React: "dependencies": { "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "grapesjs": "^0.17.19", "grapesjs-preset-webpage": "^0.1.11", "grapesjs-react": "^4.0.1-alpha", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "4.0.3", "web-vitals": "^1.1.2" },