Uh oh!
There was an error while loading. Please reload this page.
Conversation
Test file I used in different environments: importReact,{Component}from'react';importlogofrom'./logo.svg';import'./App.css';exportfunction*foo(){yield42;yield49;}exportasyncfunctionlol(){returnawaitPromise.resolve(5000);}classAppextendsComponent{render(){return(<divclassName="App"><divclassName="App-header"><imgsrc={logo}className="App-logo"alt="logo"/><h2>Welcome to React</h2></div><pclassName="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p></div>);}}varaddIndex=functionaddIndex({ index, ...routes}={},base){};functiondoSometing(){return{};}constgetId=async()=>{const{ id }=awaitdoSometing(42)returnid};constgetId2=async()=>{constp=awaitdoSometing(42)const{ id }=preturnid};functionRecord(){returnfunction(){}}constUser=newRecord({id: NaN})newUser({id: 42})exportconstx=async()=>{vary=foo()varz=y.next()while(!z.done){console.log(z.value);z=y.next();}constwow=awaitlol();console.log(wow)};x();exportdefaultApp;I tried Chrome, IE11, Node 4, and Node 7. |
Just more explaination for future ref
This is simply because I didn't account for a default in object rest spread so currently the object/rest spread transform doesn't do anything to the code and thus the syntax error.
Still need to look into it |
which is checking an Expression but getting an ObjectPattern via @benjamn just reimplemented the transform in facebook/regenerator#259 |
benjamn
commented
Dec 6, 2016
Other transforms are sometimes necessary to satisfy the preconditions of Regenerator. That's why |
Do we need to add everything from |
benjamn
commented
Dec 6, 2016
I wouldn't literally use |
gaearon
commented
Dec 6, 2016
Hmm. Is there ever a case where Node supports classes/arrows/block-scoping/for-of but not generators? |
Node 4 / 5 don't support generator |
gaearon
commented
Dec 7, 2016
@hzoo Does -env take care of this? Should I file an issue? |
@gaearon Looks like it does, for both for-of and regenerator; generators were fixed a v8 release before for-of (according to compat-table). |
gaearon
commented
Dec 7, 2016
Sounds great. Thanks! |
* master: (30 commits) Relax peerDependencies for ESLint preset (react#1191) Update Webpack to fix source map issues (react#1188) Update webpack prod config (react#1181) Chrome 'open tab' reuse an empty tab when possible (react#1165) Use file-loader for svgs (react#1180) Fix Babel issues in tests by applying the right transforms (react#1179) [babel-preset-react-app] Temporary fix missing babel plugins (react#1177) Add Subresource Integrity support (react#1176) Remove path module from webpack config on eject. (react#1175) Don't strip stack traces of evaluated webpack bundles (react#1050) Add deploy to Firebase CDN on template's README (Closesreact#374) (react#1143) Update e2e.sh (react#1167) Document what npm build does and pushState (react#933) Fix minor typo/grammar (react#1099) Add "npm run build silently fails" to Troubleshooting (react#1168) Add testURL to jest config (react#1120) Make jsx-no-undef rule an error (react#1159) Update CHANGELOG.md Publish Update changelog for 0.8.1 ...
gaearon
commented
Dec 7, 2016
Fixed in 0.8.2. https://github.com/facebookincubator/create-react-app/releases/tag/v0.8.2 |
EnoahNetzach
commented
Dec 7, 2016
tests are OK for me |
This is a followup to #1177 with a less aggressive fix.
For context, read threads #1156 and #1160.
Why this works:
testenvironment was incorrect. Itsasync: falseoption only made sense fordevelopmentandproductionconfiguration where we usebabel-preset-latest, and so async functions are already being handled. But fortestenvironment we usebabel-preset-envinstead ofbabel-preset-latest, and so including regenerator second time is redundant (and somehow breaks things—@hzoo could you clarify why this happened?)I am remove
destructuringandarrow-functionsbecause they were added as stopgap measure in #1177 but turned out unnecessary per #1156 (comment).Fixes#1156 and #1160.