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

Uncaught TypeError: Object(...) is not a function when adding Core blocks #42

Open
iandunn opened this issue Feb 11, 2021 · 1 comment

Comments

@iandunn
Copy link
Contributor

iandunn commented Feb 11, 2021

I'm trying to add some Core blocks, so that I can test a custom format I'm working on. I copied parts of the example, and it loads them. The Card tab has all the info, but I get an error when I click on the Example or Editor tabs.

Screen Shot 2021-02-11 at 7 49 20 AM

The only things in my .blockbook/index.js are:

import { registerBlockType } from 'blockbook-api';

// Register BlockBook blocks.
const coreBlocks = [
	'core/paragraph',
	'core/pullquote',
	'core/quote',
];
coreBlocks.forEach( ( block ) => registerBlockType( block ) );
Uncaught TypeError: Object(...) is not a function
    ParagraphBlock webpack:///./node_modules/@wordpress/block-library/build-module/paragraph/edit.js?:103
    React 11
    unstable_runWithPriority webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:653
    React 4
    unstable_runWithPriority webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:653
    React 3
    workLoop webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:597
    flushWork webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:552
    performWorkUntilDeadline webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:164
    EventHandlerNonNull* webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:187
    <anonymous> webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:857
    js http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:25837
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> webpack:///./node_modules/scheduler/index.js?:4
    js http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:25849
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    React 2
    js http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:23592
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> React
    js http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:23604
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> webpack:///./node_modules/@wordpress/element/build-module/react-platform.js?:2
    node_modules wordpress/element/build-module/react-platform.js@http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:13490
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> webpack:///./node_modules/@wordpress/element/build-module/index.js?:56
    node_modules wordpress/element/build-module/index.js@http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:13454
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> webpack:///./node_modules/blockbook-cli/src/app/index.js?:2
    js http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:19066
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> webpack:///multi_(webpack)-dev-server/client?:2
    0 http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:26472
    __webpack_require__ http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:20
    <anonymous> http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:84
    <anonymous> http://localhost:8081/index.f2ef4b9c7fb7d1ec5b9e.js:87
index.f2ef4b9c7fb7d1ec5b9e.js line 6558 > eval:103:97

Am I doing something wrong?

@youknowriad
Copy link
Owner

No that looks good but I've not touched the project in a while and updated packages from Core can break it. So I'm not really sure what's happening here.

In general most of the issues comes from the fact that the tool itself uses @wordpress packages and the blocks also can use these, so resolving to the right version is often very hard.

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