question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing build because of `yield` keyword

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kangaxcommented, Dec 13, 2016

We just need to release an update ASAP, since passPerPreset = false is really too troublesome.

0reactions
boopathicommented, Jan 19, 2017

passPerPreset is by default enabled in babili.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found