evenchange4 / react-intl-cra

🔧 Extract messages of Creact React App from the command line.
MIT License
67 stars 11 forks source link

Babylon throws error on decorator #41

Open ppozniak opened 6 years ago

ppozniak commented 6 years ago
react-intl-cra './src/**/*.js' -o messages.json
/home/ppozniak/.config/yarn/global/node_modules/babel-core/lib/transformation/file/index.js:590
      throw err;
      ^

SyntaxError: unknown: Unexpected token (8:0)
   6 | import { Text, LogoWrapper } from '@common';
   7 |
>  8 | @connect(state => ({

Additionally I am unable to run react-intl-cra locally. I had to install it globally or use node ./node_modules/react-intl-cra/bin

maxence-lefebvre commented 6 years ago

Hi !

I've got the same issue, did you find a workaround ?

Thank you


react-intl-cra: 0.3.3

evenchange4 commented 6 years ago

React-intl-cra does not work with decorator. Only if the official Create-react-app support it.

dachinat commented 6 years ago

@maxence-lefebvre @ppozniak if your problem is specifically transform-decorators not being loaded while parsing files, I have submitted a PR, you can use @dachinat/react-intl-cra and change script to something like

"extract": "react-intl-cra 'src/**/*.js' -o 'en.json' -b transform-decorators"