{"action":"closed","issue":{"url":"https://api.github.com/repos/codemix/babel-plugin-typecheck/issues/47","labels_url":"https://api.github.com/repos/codemix/babel-plugin-typecheck/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/codemix/babel-plugin-typecheck/issues/47/comments","events_url":"https://api.github.com/repos/codemix/babel-plugin-typecheck/issues/47/events","html_url":"https://github.com/codemix/babel-plugin-typecheck/issues/47","id":116177417,"number":47,"title":"Doesn't work with babel require hook","user":{"login":"aaronshaf","id":122654,"avatar_url":"https://avatars.githubusercontent.com/u/122654?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronshaf","html_url":"https://github.com/aaronshaf","followers_url":"https://api.github.com/users/aaronshaf/followers","following_url":"https://api.github.com/users/aaronshaf/following{/other_user}","gists_url":"https://api.github.com/users/aaronshaf/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronshaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronshaf/subscriptions","organizations_url":"https://api.github.com/users/aaronshaf/orgs","repos_url":"https://api.github.com/users/aaronshaf/repos","events_url":"https://api.github.com/users/aaronshaf/events{/privacy}","received_events_url":"https://api.github.com/users/aaronshaf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-10T18:59:00Z","updated_at":"2015-11-10T21:22:10Z","closed_at":"2015-11-10T21:22:10Z","body":"I have the following in foo.js:\r\n\r\n```javascript\r\nrequire('babel-core/register')({\r\n  'plugins': ['typecheck']\r\n})\r\n\r\nrequire('./bar')\r\n```\r\n\r\nIn bar.js:\r\n```javascript\r\nexport default function () {}\r\n```\r\n\r\nError:\r\n\r\n```\r\nTypeError: template is not a function\r\n    at createChecks (/Users/me/workspace/hello-world/node_modules/babel-plugin-typecheck/lib/index.js:322:15)\r\n    at exports.default (/Users/me/workspace/hello-world/node_modules/babel-plugin-typecheck/lib/index.js:27:16)\r\n    at Function.memoisePluginContainer (/Users/me/workspace/hello-world/node_modules/babel-core/lib/transformation/file/plugin-manager.js:77:23)\r\n    at PluginManager.add (/Users/me/workspace/hello-world/node_modules/babel-core/lib/transformation/file/plugin-manager.js:209:30)\r\n    at File.buildTransformers (/Users/me/workspace/hello-world/node_modules/babel-core/lib/transformation/file/index.js:237:21)\r\n    at new File (/Users/me/workspace/hello-world/node_modules/babel-core/lib/transformation/file/index.js:139:10)\r\n    at Pipeline.transform (/Users/me/workspace/hello-world/node_modules/babel-core/lib/transformation/pipeline.js:164:16)\r\n    at Object.transformFileSync (/Users/me/workspace/hello-world/node_modules/babel-core/lib/api/node.js:137:37)\r\n    at compile (/Users/me/workspace/hello-world/node_modules/babel-core/lib/api/register/node.js:132:20)\r\n    at normalLoader (/Users/me/workspace/hello-world/node_modules/babel-core/lib/api/register/node.js:199:14)\r\n```"}}