{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/1958","labels_url":"https://api.github.com/repos/babel/babel/issues/1958/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/1958/comments","events_url":"https://api.github.com/repos/babel/babel/issues/1958/events","html_url":"https://github.com/babel/babel/issues/1958","id":94072123,"number":1958,"title":"Getting TypeError: cannot call method 'declareTemporary' of null w/ babel + regenerator","user":{"login":"traviskaufman","id":1185269,"avatar_url":"https://avatars.githubusercontent.com/u/1185269?v=3","gravatar_id":"","url":"https://api.github.com/users/traviskaufman","html_url":"https://github.com/traviskaufman","followers_url":"https://api.github.com/users/traviskaufman/followers","following_url":"https://api.github.com/users/traviskaufman/following{/other_user}","gists_url":"https://api.github.com/users/traviskaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/traviskaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traviskaufman/subscriptions","organizations_url":"https://api.github.com/users/traviskaufman/orgs","repos_url":"https://api.github.com/users/traviskaufman/repos","events_url":"https://api.github.com/users/traviskaufman/events{/privacy}","received_events_url":"https://api.github.com/users/traviskaufman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-07-09T15:01:51Z","updated_at":"2015-07-09T16:12:20Z","closed_at":"2015-07-09T15:22:55Z","body":"Node version: v0.10.32\r\nBabel version (from `package.json`): 5.6.14\r\nRegenerator version: 0.8.31\r\n\r\nI saw a similar issue reported in #1554, but I tried following the steps outlined there and it did not solve the problem. \r\n\r\n## To reproduce\r\n\r\n1. Drop the following code in a file in a clean directory:\r\n\r\n```javascript\r\n/* jshint esnext:true, node:true */\r\n'use strict';\r\n\r\nimport Promise from 'bluebird';\r\nimport fs from 'fs';\r\nimport co from 'co';\r\n\r\nPromise.promisifyAll(fs);\r\n\r\nclass A {\r\n  foo() {\r\n    return co(function*() {\r\n      const f = yield fs.readFileAsync('/etc/hosts', 'utf8');\r\n      const lines = f.split('\\n');\r\n      while (lines.length) {\r\n        console.log(lines.shift());\r\n        yield sleep(250);\r\n      }\r\n      console.log(f);\r\n    });\r\n  }\r\n}\r\n\r\nfunction sleep(ms) {\r\n  return new Promise((resolve) => setTimeout(resolve, ms));\r\n}\r\n\r\nconst a = new A();\r\na.foo();\r\n```\r\n\r\n2. Run `npm install babel`\r\n\r\n3. Run `./node_modules/.bin/babel <filename>.js`\r\n\r\n## What should happen\r\n\r\nCode should transpile fine\r\n\r\n## What actually happens\r\n\r\nCode transpilation fails with the following error:\r\n\r\n```\r\nTypeError: <filename>.js: Cannot call method 'declareTemporary' of null\r\n    at getOuterFnExpr (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/lib/visit.js:287:36)\r\n    at Context.types.PathVisitor.fromMethodsObject.visitFunction (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/lib/visit.js:107:23)\r\n    at Context.invokeVisitorMethod (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:306:43)\r\n    at Visitor.PVp.visitWithoutReset (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:180:28)\r\n    at visitChildren (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:226:21)\r\n    at Visitor.PVp.visitWithoutReset (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:188:16)\r\n    at Visitor.PVp.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:124:25)\r\n    at Function.transform (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/node_modules/regenerator/lib/visit.js:30:11)\r\n    at NodePath.exit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/transformers/other/regenerator.js:41:34)\r\n    at NodePath.call (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:61:28)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:112:12)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitMultiple (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:92:16)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:122:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at NodePath.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:111:26)\r\n    at TraversalContext.visitSingle (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:112:12)\r\n    at TraversalContext.visit (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:124:19)\r\n    at Function.traverse.node (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:72:17)\r\n    at Object.traverse [as default] (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:55:14)\r\n    at PluginPass.transform (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/plugin-pass.js:44:27)\r\n    at File.transform (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/file/index.js:596:12)\r\n    at /private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/pipeline.js:131:19\r\n    at File.wrap (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/file/index.js:610:16)\r\n    at Pipeline.transform (/private/tmp/rg-test/node_modules/babel/node_modules/babel-core/lib/babel/transformation/pipeline.js:128:17)\r\n    at Object.exports.transform (/private/tmp/rg-test/node_modules/babel/bin/babel/util.js:34:22)\r\n    at Object.exports.compile (/private/tmp/rg-test/node_modules/babel/bin/babel/util.js:43:20)\r\n    at /private/tmp/rg-test/node_modules/babel/bin/babel/file.js:121:23\r\n    at arrayEach (/private/tmp/rg-test/node_modules/babel/node_modules/lodash/index.js:1289:13)\r\n    at Function.<anonymous> (/private/tmp/rg-test/node_modules/babel/node_modules/lodash/index.js:3345:13)\r\n    at walk (/private/tmp/rg-test/node_modules/babel/bin/babel/file.js:118:7)\r\n    at files (/private/tmp/rg-test/node_modules/babel/bin/babel/file.js:130:5)\r\n    at module.exports (/private/tmp/rg-test/node_modules/babel/bin/babel/file.js:150:5)\r\n    at Object.<anonymous> (/private/tmp/rg-test/node_modules/babel/bin/babel/index.js:145:1)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Function.Module.runMain (module.js:497:10)\r\n    at startup (node.js:119:16)\r\n    at node.js:906:3\r\n```\r\n\r\n## Notes\r\n\r\nThis code compiled fine with this version of babel _until_ I re-installed it _today_. I noticed this issue when our CI builds - which wipe out the workspace before installing - began to fail this morning. I saw [this commit](https://github.com/benjamn/ast-types/commit/9fba84a387cc78d88f0a2ad7e8f0153073ec047a#diff-4fb9c9696f2fed199e7e82fb1cbd9e37R41) in the ast-types repo that could be affecting compilation, but I'm not sure. \r\n\r\nI ran the same file through regenerator v0.8.31 without babel and it compiled fine, so I would guess it has to do with how the two modules interact with one another."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/120052159","html_url":"https://github.com/babel/babel/issues/1958#issuecomment-120052159","issue_url":"https://api.github.com/repos/babel/babel/issues/1958","id":120052159,"user":{"login":"traviskaufman","id":1185269,"avatar_url":"https://avatars.githubusercontent.com/u/1185269?v=3","gravatar_id":"","url":"https://api.github.com/users/traviskaufman","html_url":"https://github.com/traviskaufman","followers_url":"https://api.github.com/users/traviskaufman/followers","following_url":"https://api.github.com/users/traviskaufman/following{/other_user}","gists_url":"https://api.github.com/users/traviskaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/traviskaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traviskaufman/subscriptions","organizations_url":"https://api.github.com/users/traviskaufman/orgs","repos_url":"https://api.github.com/users/traviskaufman/repos","events_url":"https://api.github.com/users/traviskaufman/events{/privacy}","received_events_url":"https://api.github.com/users/traviskaufman/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T16:12:20Z","updated_at":"2015-07-09T16:12:20Z","body":"or perhaps something like `Object.getPrototypeOf(node).constructor.name === 'NodePath'` ?"}}