Failing build because of `yield` keyword
See original GitHub issueI have errors like these when building with babel-preset-babili
:
ERROR in ./src/redux/sagas/landing-menu.js
Module build failed: SyntaxError: The keyword 'yield' is reserved (1:2367)
at Parser.pp.raise (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1745:13)
at Parser.pp.parseIdent (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1464:240)
at Parser.pp.parseExprAtom (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1090:21)
at Parser.pp.parseExprSubscripts (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1023:19)
at Parser.pp.parseMaybeUnary (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1004:19)
at Parser.pp.parseExprOps (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:948:19)
at Parser.pp.parseMaybeConditional (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:930:19)
at Parser.pp.parseMaybeAssign (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:908:19)
at Parser.pp.parseVar (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2743:24)
at Parser.pp.parseVarStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2637:8)
at Parser.pp.parseStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2437:19)
at Parser.pp.parseBlock (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2692:21)
at Parser.pp.parseFunctionBody (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1413:22)
at Parser.pp.parseFunction (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2770:8)
at Parser.pp.parseFunctionStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2540:15)
at Parser.pp.parseStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2420:19)
@ ./src/redux/sagas/index.js 1:285-310
My .babelrc
:
{
"presets": [ "es2015", "stage-1", "react" ],
"plugins": [
"transform-runtime",
"transform-decorators-legacy"
],
"env": {
"production": {
"presets": ["babili"],
"plugins": [
"transform-react-inline-elements",
"transform-react-constant-elements"
]
}
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
What does the "yield" keyword do? - Stack Overflow
Basically, whenever the yield statement is encountered, the function pauses and saves its state, then emits "the next return value in the 'list'"...
Read more >Module parse failed: The keyword 'yield' is reserved #31479
Describe the Bug. npm run build fails with the following error: Module parse failed: The keyword 'yield' is reserved (453:107) File was ...
Read more >Python Yield - What does the yield keyword do? | ML+
Adding yield keyword to a function will make the function return a generator object that can be iterated upon.
Read more >A practical use of "yield" keyword in C# [closed]
The yield keyword effectively creates a lazy enumeration over collection items that can be much more efficient. For example, if your foreach loop...
Read more >yield - JavaScript - MDN Web Docs - Mozilla
The yield keyword causes the call to the generator's next() method to return an IteratorResult object with two properties: value and done ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We just need to release an update ASAP, since
passPerPreset = false
is really too troublesome.passPerPreset is by default enabled in babili.