Skip to content

Scripts: Problem with build command when using multiple blocks scaffolded with create block #27969

@S-Blank

Description

@S-Blank

Good day,

I have been having problems developing Gutenberg blocks for days.

I use ‘@wordpress/create-block’ to build my blocks. As long as I build the blocks with ‘npm start’, the blocks work fine and without any error messages, but as soon as I use ‘npm run build’ for building, I get problems, especially if other custom blocks of mine are already installed (the new block or other blocks can no longer be found in the editor, or throw an error message: ‘Object(…) is not a function at anonymus’). Sometimes renaming the new block and clearing the browser cache / website cache helps, sometimes not.
If I then build the block again via ‘npm start’, everything works again.

Does anyone have an idea what this could be?

Many thanks in advance for your help.

Many greetings
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Status] Needs More InfoFollow-up required in order to be actionable.[Tool] WP Scripts/packages/scripts[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions