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.

[babel-plugin-flow-runtime] cannot read .name of null

See original GitHub issue

using default plugin config (flow-runtime), or as object with the defaults explicitly specified ('assert': true, 'decorate': true…)

Cannot read property 'name' of null
   at converters.FunctionTypeParam (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:539:29)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:512:12
   at Array.map (native)
   at converters.FunctionTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:511:62)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.ObjectTypeProperty (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:498:15)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:488:12
   at Array.map (native)
   at converters.ObjectTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:487:114)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:304:14)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:40:11)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:512:12
   at Array.map (native)
   at converters.FunctionTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:511:62)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.ObjectTypeProperty (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:498:15)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:488:12
   at Array.map (native)
   at converters.ObjectTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:487:114)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:304:14)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at NodePath.traverse (/project/node_modules/babel-traverse/lib/path/index.js:144:25)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:40:11)
   at converters.ObjectTypeProperty (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:498:15)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:488:12
   at Array.map (native)
   at converters.ObjectTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:487:114)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:304:14)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at NodePath.traverse (/project/node_modules/babel-traverse/lib/path/index.js:144:25)
   at PluginPass.Program (/project/node_modules/babel-plugin-flow-runtime/lib/index.js:20:14)
   at newFn (/project/node_modules/babel-traverse/lib/visitors.js:276:21)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:40:11)
   at /project/node_modules/babel-plugin-flow-runtime/lib/convert.js:488:12
   at Array.map (native)
   at converters.ObjectTypeAnnotation (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:487:114)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at converters.TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:304:14)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at NodePath.traverse (/project/node_modules/babel-traverse/lib/path/index.js:144:25)
   at PluginPass.Program (/project/node_modules/babel-plugin-flow-runtime/lib/index.js:20:14)
   at newFn (/project/node_modules/babel-traverse/lib/visitors.js:276:21)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:40:11)
   at converters.TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:304:14)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:38:12)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at NodePath.traverse (/project/node_modules/babel-traverse/lib/path/index.js:144:25)
   at PluginPass.Program (/project/node_modules/babel-plugin-flow-runtime/lib/index.js:20:14)
   at newFn (/project/node_modules/babel-traverse/lib/visitors.js:276:21)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitSingle (/project/node_modules/babel-traverse/lib/context.js:108:19)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:192:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at convert (/project/node_modules/babel-plugin-flow-runtime/lib/convert.js:40:11)
   at TypeAlias (/project/node_modules/babel-plugin-flow-runtime/lib/transformVisitors.js:69:47)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitMultiple (/project/node_modules/babel-traverse/lib/context.js:103:17)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:190:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at NodePath.traverse (/project/node_modules/babel-traverse/lib/path/index.js:144:25)
   at PluginPass.Program (/project/node_modules/babel-plugin-flow-runtime/lib/index.js:20:14)
   at newFn (/project/node_modules/babel-traverse/lib/visitors.js:276:21)
   at NodePath._call (/project/node_modules/babel-traverse/lib/path/context.js:76:18)
   at NodePath.call (/project/node_modules/babel-traverse/lib/path/context.js:48:17)
   at NodePath.visit (/project/node_modules/babel-traverse/lib/path/context.js:105:12)
   at TraversalContext.visitQueue (/project/node_modules/babel-traverse/lib/context.js:150:16)
   at TraversalContext.visitSingle (/project/node_modules/babel-traverse/lib/context.js:108:19)
   at TraversalContext.visit (/project/node_modules/babel-traverse/lib/context.js:192:19)
   at Function.traverse.node (/project/node_modules/babel-traverse/lib/index.js:114:17)
   at traverse (/project/node_modules/babel-traverse/lib/index.js:79:12)
   at File.transform (/project/node_modules/babel-core/lib/transformation/file/index.js:558:35)

https://github.com/codemix/flow-runtime/blob/master/packages/babel-plugin-flow-runtime/src/firstPassVisitors.js

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
phpnodecommented, Jan 9, 2017

fixed in v0.0.4

0reactions
matthewbptcommented, Jan 9, 2017

I get this error too, and I narrowed it down to anywhere where my code does a default export of an anonymous function or class, or directly exports an arrow function. I went through all my code making sure everything has a proper name and now it no longer throws that error during compilation. It’s a common pattern for small Stateless React Components to just export an anonymous arrow function directly, so I think this bug should be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'name' of null · Issue #10462 - GitHub
Hi,. I just want to ask if how can i fix this issue Cannot read property 'name' of null? ... "babel-plugin-transform-inline-environment-variables" ...
Read more >
Options - Babel.js
If passing options via @babel/cli you'll need to kebab-case the names. i.e. ... "preset-" instead of "plugin-", and presets cannot be instances of...
Read more >
babel-plugin-flow-runtime - npm
A babel plugin which transforms Flow annotations into Type instances available at runtime, and optionally checks values against those types.
Read more >
How to avoid 'cannot read property of undefined' errors?
The error is probably a regular Javascript exception, so try the try..catch statement. That said, an array that contains wildly heterogenous ...
Read more >
Babel - Storybook
Storybook's webpack config by default sets up Babel for ES6 transpiling. ... Check out our source to learn more about these plugins.
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