Is this a bug report?
Yes
Did you try recovering your dependencies?
1.6.0
Which terms did you search for in User Guide?
Babel, Generator Functions
Environment
node -v: 8.11.1
npm -v: 5.6.0
yarn --version (if you use Yarn): 1.6.0
npm ls react-scripts (if you haven’t ejected): react-scripts@2.0.0-next.66cc7a90
Then, specify:
- Operating system: Windows 10
- Browser and version (if relevant): Chrome 65.0.3325.181, Firefox Quantum 59.0.2 (64-bit)
Steps to Reproduce
During a development build Babel does not correctly convert generator functions in a class. The exact issue I am experiencing is described in this issue facebook/regenerator#287 but that appears to have since been resolved. This issue only occurs in a development build and works correctly during a production build. It was working correctly in react-scripts 1.x. - react-scripts@2.0.0-next.66cc7a90 is the first 2.x build I have tried. This may be a Babel issue rather than a CRA issue.
- Create a generator class
export default class GeneratorClass {
*getReply(msg) {
yield msg;
}
}
- Invoke the classs
const reply = new Reply();
var r = reply.getReply('Hello ');
console.log('gen', r.next());
- yarn start
- ReferenceError: _callee is not defined
Expected Behavior
Babel correctly transpiles generator functions in a class and no error is given
Actual Behavior
The error:
ReferenceError: _callee is not defined
Reproducible Demo
https://github.com/robertedjones/my-app
Is this a bug report?
Yes
Did you try recovering your dependencies?
1.6.0
Which terms did you search for in User Guide?
Babel, Generator Functions
Environment
node -v: 8.11.1npm -v: 5.6.0yarn --version(if you use Yarn): 1.6.0npm ls react-scripts(if you haven’t ejected): react-scripts@2.0.0-next.66cc7a90Then, specify:
Steps to Reproduce
During a development build Babel does not correctly convert generator functions in a class. The exact issue I am experiencing is described in this issue facebook/regenerator#287 but that appears to have since been resolved. This issue only occurs in a development build and works correctly during a production build. It was working correctly in react-scripts 1.x. - react-scripts@2.0.0-next.66cc7a90 is the first 2.x build I have tried. This may be a Babel issue rather than a CRA issue.
Expected Behavior
Babel correctly transpiles generator functions in a class and no error is given
Actual Behavior
The error:
ReferenceError: _callee is not defined
Reproducible Demo
https://github.com/robertedjones/my-app