Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Module parse failed: Unexpected token while compiling block #304

Open
@carlosmiei

Description

@carlosmiei

Bug Report

Expected Behavior

I've created a fairly simple block that imports some features from the @WordPress package (example below).
image

However when I try to compile it fails with this error:

image

I already tried a bunch of stuff to overcome this, but none was successful.

  • Eject the block and try to add the preset @babel/preset-react , @babel/preset-env, etc
  • Update babel
  • Change babel plugins options
  • etc

Actual Behavior

(Write what happened. Please add screenshots!)

Steps to Reproduce

(Write your steps here:)

  1. Bootstrap a block
  2. npm install @wordpress/block-editor --save
  3. Import something from the @WordPress package
  4. Try to run: npm start
  1. node -v: 12.8.1
  2. npm -v: 6.14.5

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant):

Possible Solution

Reproducible Demo

I'm attaching a zip file with a reproducible demo, not ejected.
Link: https://drive.google.com/file/d/18UlVUdzxDwj8GdfQ3USN5kJ9oR1uVMMI/view?usp=sharing

(Paste the link to an example project and exact instructions to reproduce the issue.)

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