Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-app-rewire-mobx not working with decorator @observable #77

Closed
topvis opened this issue Aug 29, 2017 · 4 comments
Closed

react-app-rewire-mobx not working with decorator @observable #77

topvis opened this issue Aug 29, 2017 · 4 comments

Comments

@topvis
Copy link

topvis commented Aug 29, 2017

react-scripts version 1.0.12.

I following the instruction from this link: https://github.com/timarney/react-app-rewired/tree/master/packages/react-app-rewire-mobx

The app will run without decorator. Once I use decorator, I got "Syntax error: C:/.../...js: Unexpected token" at the "@observable".

Did I miss anything?

I tried installing babel-plugin-transform-decorators-legacy and then added config = injectBabelPlugin('transform-decorators-legacy',config); in the config-overrides.js and it didn't work either.

Thanks.

@timarney
Copy link
Owner

Please try cloning and running this repo to see if it works for you - https://github.com/timarney/mobx-rewire-test I updated it to the latest 1.0.12 release and the tests are passing.

@topvis
Copy link
Author

topvis commented Aug 29, 2017

@timarney I tried it and I got the same error. I also saw this message "babel-loader not found" message after running yarn start (see screenshot below). I do have babel-loader installed. I'm in Windows 10.

image

@timarney
Copy link
Owner

That error would be coming from this file.

https://github.com/timarney/react-app-rewired/blob/master/packages/react-app-rewired/index.js

Right for time these days but I'll dig into it further as time allows.

@topvis
Copy link
Author

topvis commented Aug 30, 2017

I removed the slash "/" from this row: return rule.loader && rule.loader.indexOf("babel-loader/") != -1; in https://github.com/timarney/react-app-rewired/blob/master/packages/react-app-rewired/index.js
Now it works!

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

No branches or pull requests

2 participants