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

Module parse failed: Unexpected token while compiling block #304

Open
carlosmiei opened this issue Dec 4, 2021 · 0 comments
Open

Module parse failed: Unexpected token while compiling block #304

carlosmiei opened this issue Dec 4, 2021 · 0 comments

Comments

@carlosmiei
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant