Patryk Jabłoński
Patryk Jabłoński

Reputation: 747

mobx-react-boilerplate @ unexpected token

I wanted to start new React project. I decided to use Mobx. I have found boilerplate that seemed to be perfect to use to start. I have fetched https://github.com/mobxjs/mobx-react-boilerplate and I have encountered A problem. When I execute npm start occurs:

Module build failed: SyntaxError: Unexpected token (4:2)

  2 | 
  3 | export default class TodoModel {
> 4 |   @observable title;
    |   ^
  5 |   @observable finished = false;
  6 | 
  7 |   constructor(title) {

How can I get rid of this problem? I thought that setup in this boilerplate would let me use @observable.

UPDATE

I have reinstalled the boilerplate and now I have another issue.

Module build failed: SyntaxError: Unexpected token (12:2)

  10 | 
  11 | render(
> 12 |   <div>
     |   ^
  13 |     <DevTools />
  14 |     <TodoList store={store} />
  15 |   </div>,

Upvotes: 1

Views: 533

Answers (1)

Daniel In&#225;cio
Daniel In&#225;cio

Reputation: 26

Install this in your project first:

https://github.com/timarney/react-app-rewired/tree/master/packages/react-app-rewire-mobx

and change your package.json

"start": "react-app-rewired start",
"build": "react-app-rewired build"

Upvotes: 1

Related Questions