Flow: "You or one of the Babel plugins you are using are using Flow declarations as bindings"

Created on 14 Mar 2016  Â·  17Comments  Â·  Source: facebook/flow

Babelify/browserify started to print this message for me.

    You or one of the Babel plugins you are using are using Flow declarations as bindings.
    Support for this will be removed in version 6.8. To find out the caller, grep for this
    message and change it to a `console.trace()`.

I am using:

  • es2015 babel preset
  • transform-flow-strip-types, transform-class-properties, add-module-exports and add-module-exports plugins

Should I be worried about something?

Most helpful comment

+1

All 17 comments

It probably has something to do with this issue - https://github.com/babel/babel/pull/3414

I can't really tell what "using Flow declaraion as bindings" mean. But it's probably not Flow issue anyway.

I have problems reducing it to a simple case, since I am now in a deadline :)

cc @amasad

What 'babel-traverse' version are you on? You can use npm ls

+1

@cucung: Can you try using npm ls to give @amasad some sense of how you're hitting this as well?

Hm. I am out of the deadline, so I tried it again, with new npm modules, and it doesn't appear again :( I cannot replicate anymore.

Yeah it was a bad release 6.7.2 but it's fixed in 6.7.3. Feel free to close the issue if it's good now.

I'm suing babel-traverse version 6.7.6 but I have same error. It's dispatched at line 976 in file babel-traverse/lib/scope/lib/index.js Did it came back?

@nirth Same here. Here is the context: https://github.com/codemix/babel-plugin-typecheck/issues/134#issuecomment-213949347

The error does not explain what to use instead of getBinding.

I wanted to follow up with a getTypeBinding method but didn't have the
chance yet

On Sun, Apr 24, 2016, 5:19 AM Gajus Kuizinas [email protected]
wrote:

@nirth https://github.com/nirth Same here. Here is the context: codemix/babel-plugin-typecheck#134
(comment)
https://github.com/codemix/babel-plugin-typecheck/issues/134#issuecomment-213949347

The error does not explain what to use instead of getBinding.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/facebook/flow/issues/1538#issuecomment-213949513

Hi, I receive this error during babel compilation, was this actually fixed?

@tomitrescak Try blowing away your node_modules and reinstalling with the latest versions

I did that. Still no luck. These are the versions I have:

"babel": "^6.5.2",
    "babel-cli": "^6.11.4",
    "babel-core": "^6.10.4",
    "babel-eslint": "^6.0.4",
    "babel-plugin-syntax-async-functions": "^6.8.0",
    "babel-plugin-syntax-flow": "^6.13.0",
    "babel-plugin-transform-class-properties": "^6.11.5",
    "babel-plugin-transform-flow-strip-types": "^6.8.0",
    "babel-plugin-transform-object-rest-spread": "^6.8.0",
    "babel-plugin-transform-regenerator": "^6.9.0",
    "babel-preset-es2015": "^6.6.0",

And this is my .babelrc

{
  "presets": [
    "es2015"
  ],
  "plugins": [
    "babel-plugin-syntax-flow",
    "syntax-async-functions",
    "transform-regenerator",
    "transform-object-rest-spread"
  ]
}

Putting this here in case it's helpful for anyone. I was getting this because I had some type aliases defined and then also had a function argument defined with the exact same name as the type alias, like so:

type MyThing = string;

function doThing(MyThing: MyThing) {}

You can see it being logged out here on the Babel repl: link.

To find the offending code, I went into babel-traverse and logged out the entire binding. Renaming either the type alias or the argument got rid of the warning.

I too am getting this message. The suggested fixes in this thread did not work in my case.

@npbee seems like your problem is a bug in babel with how to treat the scopes of the two different MyThing's.

in my case removing debug_v2.x.x and bluebird_v3.x.x libdefs that were included by flow-typed cli solved the problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TylerEich picture TylerEich  Â·  49Comments

opensrcery picture opensrcery  Â·  88Comments

NgoKnows picture NgoKnows  Â·  40Comments

sebmck picture sebmck  Â·  113Comments

StoneCypher picture StoneCypher  Â·  253Comments