create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Module parse failed: Unexpected token while compiling block

Open carlosmiei opened this issue 2 years ago • 0 comments

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.)

carlosmiei avatar Dec 04 '21 14:12 carlosmiei