-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Scripts: Problem with build command when using multiple blocks scaffolded with create block #27969
Description
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