ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.15k stars 328 forks source link

Module parse failed: Unexpected token while compiling block #304

Open carlosmiei opened 2 years ago

carlosmiei commented 2 years ago

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.

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