Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with implementation of the Isolated Block Editor in a NextJS application #257

Open
crs1138 opened this issue Apr 15, 2024 · 2 comments

Comments

@crs1138
Copy link

crs1138 commented Apr 15, 2024

Context of my problem

I am trying to use the Gutenberg Block Editor within a React/NextJS-based application as a UI for a headless CMS. Here is a link to the repo that I used to create a very simplified version of our project. However, I couldn't get this to work.

To reproduce the problem in detail, please clone the repository and checkout the install-isolated-block-editor branch. Then follow the installation instruction as described in the /README.md

Details about implementation

As the '@automattic/isolated-block-editordoes not have any package-lock.json (or its equivalent) the dependencies specified in thepackage.jsondo not get installed if the repo itself is used as a dependency. Thus I tried recreated the@automattic/isolated-block-editor/src/index.jsascrs1138/turborepo-nextjs-with-isolated-block-editor/packages/block-editor/IsolatedBlockEditor.tsxand installed all the dependencies imported in this file. This is then re-exported as a simple React component and used on the pagegbof theatlas-editor` web app. Once you have the local development server running you can access this page at http://localhost:3001/gb.

Problem

Upon compilation of the http://localhost:3001/gb the following error is displayed.

NextJS error

Please, help me to get to understand what is the problem and provide a direction in what it could be resolved.


The full stack that can be found in the terminal:

atlas-editor:dev: TypeError: (0 , _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js:16:82)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:40:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js:7:66)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:50:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/use-select/index.js:10:89)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/use-select/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:80:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/with-select/index.js:9:69)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/with-select/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:110:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/index.js:33:81)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:160:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/store/index.js:6:73)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/store/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:530:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/index.js:77:64)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:490:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/bindings/index.js:2:75)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/bindings/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected]_@[email protected][email protected][email protected]:20:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/index.js:154:67)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected]_@[email protected][email protected][email protected]:1530:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx:15:75)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:278:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../packages/block-editor/src/block-editor.tsx:8:78)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/block-editor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:289:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/./app/gb/page.tsx:7:89)
atlas-editor:dev:     at (rsc)/./app/gb/page.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:256:1)
atlas-editor:dev:     at Function.__webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at async eB (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:402523)
atlas-editor:dev:     at async tt (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406237)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406787)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406918)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406918)
atlas-editor:dev:     at async tl (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:36:2057)
atlas-editor:dev:     at async /Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:36:2596 {
atlas-editor:dev:   digest: '2848306707'
atlas-editor:dev: }
atlas-editor:dev:  ⨯ ../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (10:37) @ defaultRegistry
atlas-editor:dev:  ⨯ TypeError: (0 , _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/IsolatedBlockEditor.tsx:15:75)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:278:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/block-editor.tsx:8:78)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/block-editor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:289:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (./app/gb/page.tsx:7:89)
atlas-editor:dev:     at (rsc)/./app/gb/page.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:256:1)
atlas-editor:dev:     at Function.__webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at async Promise.all (index 0)
atlas-editor:dev:     at async Promise.all (index 0)
atlas-editor:dev: null
atlas-editor:dev:  ⨯ ../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (10:37) @ defaultRegistry
atlas-editor:dev:  ⨯ TypeError: (0 , _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/IsolatedBlockEditor.tsx:15:75)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:278:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/block-editor.tsx:8:78)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/block-editor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:289:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (./app/gb/page.tsx:7:89)
atlas-editor:dev:     at (rsc)/./app/gb/page.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:256:1)
atlas-editor:dev:     at Function.__webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at async Promise.all (index 0)
atlas-editor:dev:     at async Promise.all (index 0)
atlas-editor:dev: digest: "2359287421"
atlas-editor:dev: null
atlas-editor:dev:  ⨯ ../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (10:37) @ defaultRegistry
atlas-editor:dev:  ⨯ TypeError: (0 , _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/IsolatedBlockEditor.tsx:15:75)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:278:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (../../packages/block-editor/src/block-editor.tsx:8:78)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/block-editor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:289:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (./app/gb/page.tsx:7:89)
atlas-editor:dev:     at (rsc)/./app/gb/page.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:256:1)
atlas-editor:dev:     at Function.__webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev: null
atlas-editor:dev:  ⨯ ../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (10:37) @ defaultRegistry
atlas-editor:dev:  ⨯ TypeError: (0 , _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js:16:82)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/context.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:40:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js:7:66)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:50:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/use-select/index.js:10:89)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/use-select/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:80:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/datlas-editor:dev: omponents/with-select/index.js:9:69)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/components/with-select/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:110:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/index.js:33:81)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/data/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:160:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/store/index.js:6:73)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/store/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:530:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/index.js:77:64)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@wordpress/blocks/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected][email protected]:490:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/bindings/index.js:2:75)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/bindings/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected]_@[email protected][email protected][email protected]:20:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/index.js:154:67)
atlas-editor:dev:     at (rsc)/../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@wordpress/editor/build-module/index.js (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/vendor-chunks/@[email protected]_@[email protected][email protected][email protected]:1530:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx:15:75)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/IsolatedBlockEditor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:278:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/../../packages/block-editor/src/block-editor.tsx:8:78)
atlas-editor:dev:     at (rsc)/../../packages/block-editor/src/block-editor.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:289:1)
atlas-editor:dev:     at __webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at eval (webpack-internal:///(rsc)/./app/gb/page.tsx:7:89)
atlas-editor:dev:     at (rsc)/./app/gb/page.tsx (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/app/gb/page.js:256:1)
atlas-editor:dev:     at Function.__webpack_require__ (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/apps/atlas-editor/.next/server/webpack-runtime.js:33:43)
atlas-editor:dev:     at async eB (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:402523)
atlas-editor:dev:     at async tt (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406237)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406787)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406918)
atlas-editor:dev:     at async tr (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:406918)
atlas-editor:dev:     at async tl (/Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:36:2057)
atlas-editor:dev:     at async /Users/jpozivil/Sites/private/playground/turborepo-nextjs-with-isolated-block-editor/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:36:2596 {
atlas-editor:dev:   digest: '2848306707',
atlas-editor:dev:   page: '/gb'
atlas-editor:dev: }
atlas-editor:dev: null
@crs1138
Copy link
Author

crs1138 commented Apr 15, 2024

This ticket is based on the recommendation at #248 (comment) to open a new separate ticket.

@manutheblacker
Copy link

Have you tried to run your component in client only mode ?

i'm trying something similar too, here is the code i've used so far :

import {React} from 'react';
import { useState, useEffect } from 'react';
import '@automattic/isolated-block-editor/build-browser/core.css';
import '@automattic/isolated-block-editor/build-browser/isolated-block-editor.css';
import IsolatedBlockEditor, { EditorLoaded, DocumentSection, ToolbarSlot } from '@automattic/isolated-block-editor';

function App() {
  return (
    <>
    <IsolatedBlockEditor
		settings={ settings }
		onSaveContent={ ( html ) => saveContent( html ) }
		onLoad={ ( parse ) => loadInitialContent( parse ) }
		onError={ () => document.location.reload() }
	>
		<EditorLoaded onLoaded={ () => {} } onLoading={ () => {} } />
		<DocumentSection>Extra Information</DocumentSection>

		<ToolbarSlot>
			<button>Beep!</button>
		</ToolbarSlot>
	</IsolatedBlockEditor>
    </>
  )
}

export default App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants