Ignite: decorators-legacy - Support for the experimental syntax 'decorators-legacy' isn't currently enabled

Created on 23 Feb 2019  路  2Comments  路  Source: infinitered/ignite

Hi,
Having a problem with decorators, getting "'decorators-legacy' isn't currently enabled"


What's going on?

error: bundling failed: SyntaxError: /Users/bartek/code/reactnative/ignite/Test3/node_modules/react-native/app/navigation/back-button-handler.tsx: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (15:1):

Steps to reproduce

ignite new Test3
Which boilerplate would you like to use? Bowser (React Navigation, MobX State Tree, & T
ypeScript)
react-native run-ios
Loading dependency graph, done.
 BUNDLE  [ios, dev] ../../index.js 鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒鈻戔枒鈻戔枒鈻戔枒 61.6% (1033/1316)::1 - - [23/Feb/2019:20:53:53 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "Test3/1 CFNetwork/975.0.3 Darwin/18.2.0"
error: bundling failed: SyntaxError: /Users/bartek/code/reactnative/ignite/Test3/node_modules/react-native/app/navigation/back-button-handler.tsx: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (15:1):

  13 | }
  14 | 
> 15 | @inject("navigationStore")
     | ^
  16 | @observer
  17 | export class BackButtonHandler extends React.Component<BackButtonHandlerProps, {}> {
  18 |   /**
    at Object.raise (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:3831:17)
    at Object.expectOnePlugin (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:5158:18)
    at Object.parseDecorator (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7431:10)
    at Object.parseDecorators (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7413:30)
    at Object.parseStatement (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7240:12)
    at Object.parseBlockOrModuleBlockBody (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7810:25)
    at Object.parseBlockBody (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7797:10)
    at Object.parseTopLevel (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:7181:10)
    at Object.parse (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:8658:17)
    at parse (/Users/bartek/code/reactnative/ignite/Test3/node_modules/@babel/parser/lib/index.js:10646:26)
 BUNDLE  [ios, dev] ../../index.js 鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒 99.3% (1371/1376)

ignite doctor results:

  platform           darwin                                                                                             
  arch               x64                                                                                                
  cpu                8 cores                                       Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz  
  directory          /Users/bartek/code/reactnative/ignite/Test3                                                        

JavaScript
  node               11.10.0      /usr/local/bin/node  
  npm                6.4.1        /usr/local/bin/npm   
  yarn               1.13.0       /usr/local/bin/yarn  

React Native
  react-native-cli   2.0.1       
  app rn version     0.57.8      

Ignite
  ignite             2.2.2           /usr/local/bin/ignite  
  boilerplate        ignite-bowser                                    

Android
  java               1.8.0_201    /usr/bin/java                      
  android home       -            /Users/bartek/Library/Android/sdk  

iOS
  xcode              10.1        

Most helpful comment

Just ran into this myself. Running this fixed it:

$ yarn
$ react-native start --reset-cache

All 2 comments

When you get this error it means dev dependencies weren't installed. Running npm i --dev should resolve it for you.

Just ran into this myself. Running this fixed it:

$ yarn
$ react-native start --reset-cache
Was this page helpful?
0 / 5 - 0 ratings