fix: add exports field to create-block-interactive-template#72687
fix: add exports field to create-block-interactive-template#72687harshbhonsle wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @david-j-figueroa. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @harshbhonsle! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
Hi @harshbhonsle, it seems we can simply remove the exports field. See #72694 I'd like to close this PR, but thank you for your efforts! |
What?
Closes #72639
Fixes the broken @wordpress/create-block-interactive-template by adding a missing "exports" field to its package.json. This resolves the error thrown when using the template with create-block.
Why?

Currently, when using the interactive template with npx @wordpress/create-block, the CLI fails with the error:
Code
Invalid plugin template downloaded. Error: No "exports" main defined...
This happens because the published package lacks an "exports" field, which is required for Node.js to resolve the entry point correctly. Adding this field restores compatibility with the CLI and allows the template to be used as intended.
How?
Added the following to packages/create-block-interactive-template/package.json:
This ensures the template can be resolved properly when downloaded and used by create-block.
Testing Instructions
Rebuild Gutenberg to apply the fix:
Navigate to the Gutenberg repo root:
Run the create-block CLI directly using Node:
Confirm that:
Testing Instructions for Keyboard
Not applicable — this PR does not affect UI or accessibility.