Babel ES7 Leading decorators must be attached to a class declaration

If you ever find yourself seeing this error, the solution is very simple. Remove the semicolon behind your attributes.


As an example, here’s the (current) default app.js from Aurelia. I’ve introduced the bug on line 7.

Upon adding a semicolon behind your decorator (@inject(Router)) you’ll find yourself having above error. So, to fix the error simply remove the semicolon.


Add yours →

  1. You are a live saver. : D

1 Pingback

  1. URL

Leave a Reply

3 + = eleven

©SpoonX 2018