react-intl-cra icon indicating copy to clipboard operation
react-intl-cra copied to clipboard

Babylon throws error on decorator

Open ppozniak opened this issue 7 years ago • 3 comments

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

ppozniak avatar Feb 21 '18 09:02 ppozniak

Hi !

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

Thank you


react-intl-cra: 0.3.3

maxence-lefebvre avatar Mar 24 '18 21:03 maxence-lefebvre

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

evenchange4 avatar Mar 26 '18 01:03 evenchange4

@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"

dachinat avatar Apr 04 '18 11:04 dachinat