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.

Feature request: support Babel 7

See original GitHub issue

This is a:

  • Bug Report
  • Feature Request

Which concerns:

  • babel-plugin-flow-runtime

What is the current behaviour?

The complete configuration is here: https://github.com/OKNoah/flow-runtime-test/pull/2/files

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-stage-2"
  ],
  "plugins": [
    ["flow-runtime"],
    "transform-decorators-legacy"
  ]
}
/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/lib/transformation/normalize-file.js:136
    throw err;
    ^

SyntaxError: /Users/noah/Projects/flow-runtime-test/index.js: Unexpected token, expected ";" (3:5)

  1 | // @flow-runtime
  2 | 
> 3 | type User = {
    |      ^
  4 |   name: string
  5 | };
  6 | 
    at Parser.raise (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:832:15)
    at Parser.unexpected (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:2212:16)
    at Parser.semicolon (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:2192:40)
    at Parser.parseExpressionStatement (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4729:10)
    at Parser.parseStatementContent (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4327:19)
    at Parser.parseStatement (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4206:17)
    at Parser.parseBlockOrModuleBlockBody (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4764:23)
    at Parser.parseBlockBody (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4750:10)
    at Parser.parseTopLevel (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:4174:10)
    at Parser.parse (/Users/noah/Projects/flow-runtime-test/node_modules/@babel/core/node_modules/babylon/lib/index.js:5613:17)
[nodemon] app crashed - waiting for file changes before starting...

What is the expected behaviour?

Should run without errors and do a console log.


Which package versions are you using?

"@babel/core": "^7.0.0-beta.36",
"@babel/preset-env": "^7.0.0-beta.36",
"@babel/preset-stage-2": "^7.0.0-beta.36",
"@babel/register": "^7.0.0-beta.36",
"babel-plugin-flow-runtime": "^0.15.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"flow-runtime": "^0.16.0"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
0rvarcommented, Aug 28, 2018

Babel 7 has been released!

7reactions
JacopKanecommented, Mar 4, 2018

Currently, this is the only one preset that is stopping us migrating to babel 7. Wish I’ve had some AST experience. I will try to check it out later if it’s something I can handle

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade to Babel 7
Refer users to this document when upgrading to Babel 7. ... Support for Node.js 0.10, 0.12, 4 and 5 has been dropped #5025,...
Read more >
Babel 7 Released
After almost 2 years, 4k commits, over 50 pre-releases, and a lot of help we are excited to announce the release of Babel...
Read more >
Upgrade to Babel 7 (API)
All Babel packages. NodeJS support. high. Support for Node.js 0.10 and 0.12 has been dropped as both of this versions are out of...
Read more >
Options - Babel.js
The filename is exposed to plugins. Some plugins may require the presence of the filename. ... In older Babel 7 versions, only babel.config.js...
Read more >
babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript ... environments gained support of a JavaScript syntax or...
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