Skip to content

ERROR: on yarn/npm build; can't "import json from './json';" (should be ./block.json) #2

@trulycool

Description

@trulycool

Greetings, and thanks so much for sharing this code!

In trying it out, I was not able to build & thus use it. Looking at recent commit message, I see you were removing the dependency to hard code the name each time.

Clearly you intended to import block.json to get the name. However, each block has that same import error.

I changed:

import json from './json';

...to:

import json from './block.json';

...and it works fine.

Thanks again, and I look very forward to checking out the custom template for @wordpress/create-block that will scaffold in the tailwind stuff; what a great idea!

All the best,
Morgan
😌🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions