{"action":"created","issue":{"url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/21","labels_url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/21/comments","events_url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/21/events","html_url":"https://github.com/thlorenz/proxyquireify/issues/21","id":50471448,"number":21,"title":"ReferenceError: Can't find variable: require","user":{"login":"mg","id":1972,"avatar_url":"https://avatars.githubusercontent.com/u/1972?v=3","gravatar_id":"","url":"https://api.github.com/users/mg","html_url":"https://github.com/mg","followers_url":"https://api.github.com/users/mg/followers","following_url":"https://api.github.com/users/mg/following{/other_user}","gists_url":"https://api.github.com/users/mg/gists{/gist_id}","starred_url":"https://api.github.com/users/mg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg/subscriptions","organizations_url":"https://api.github.com/users/mg/orgs","repos_url":"https://api.github.com/users/mg/repos","events_url":"https://api.github.com/users/mg/events{/privacy}","received_events_url":"https://api.github.com/users/mg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":32,"created_at":"2014-11-30T21:29:39Z","updated_at":"2015-01-13T14:05:29Z","closed_at":"2015-01-13T04:07:16Z","body":"Can't get rid of this error. Here's my package.json:\r\n```\r\n{\r\n  \"name\": \"\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"dependencies\": {\r\n  },\r\n  \"devDependencies\": {\r\n    \"karma\": \"~0.12.25\",\r\n    \"karma-jasmine\": \"~0.2.3\",\r\n    \"karma-phantomjs-launcher\": \"~0.1.4\",\r\n    \"karma-junit-reporter\": \"~0.2.2\",\r\n    \"jshint-stylish\": \"~1.0.0\",\r\n    \"browserify\": \"~6.3.3\",\r\n    \"proxyquireify\": \"~1.1.0\",\r\n    \"karma-browserify\": \"~1.0.0\"\r\n  }\r\n}\r\n```\r\n\r\nkarma.conf.js\r\n```\r\nmodule.exports = function(config) {\r\n  config.set({\r\n    basePath : '.',\r\n\r\n    autoWatch : false,\r\n    singleRun: true,\r\n\r\n    frameworks: ['jasmine', 'browserify'],\r\n    \r\n    browsers : ['PhantomJS'],\r\n    \r\n    plugins : [\r\n      'karma-browserify',\r\n      'karma-jasmine',\r\n      'karma-junit-reporter',\r\n      'karma-phantomjs-launcher'\r\n    ],\r\n\r\n    preprocessors: {\r\n      '*.spec.js': [ 'browserify' ]\r\n    },\r\n\r\n    browserify: {\r\n      debug: true,\r\n      plugin: ['proxyquireify/plugin']\r\n    },\r\n\r\n    junitReporter : {\r\n      outputFile: 'test_out/unit.xml',\r\n      suite: 'unit'\r\n    },\r\n\r\n    files: ['*.js']\r\n  });\r\n};\r\n```\r\n\r\nhello.js\r\n```\r\nexports= {\r\n  hello: function() {\r\n    return \"hello\";\r\n  }\r\n};\r\n```\r\n\r\nhello.spec.js\r\n```\r\nvar proxyquire =  require('proxyquireify')(require);\r\n\r\ndescribe('testing hello', function () {\r\n\tvar Hello= proxyquire('./hello');\r\n\r\n\tit('should say hi', function() {\r\n\t\texpect(Hello.hell()).toBe('hello');\r\n\t});\r\n\r\n});\r\n```\r\n\r\nOutput from karma start karma.conf.js --log-level debug\r\n```\r\nDEBUG [config]: Loading config /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/karma.conf.js\r\nDEBUG [plugin]: Loading plugin karma-browserify.\r\nDEBUG [plugin]: Loading plugin karma-jasmine.\r\nDEBUG [plugin]: Loading plugin karma-junit-reporter.\r\nDEBUG [plugin]: Loading plugin karma-phantomjs-launcher.\r\nDEBUG [framework.browserify]: created browserify bundle: /var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/9409150f6698b81bf6aaf0b28d56eb7f01704769.browserify\r\nDEBUG [framework.browserify]: no matching preprocessed file was found, defaulting to prepend\r\nDEBUG [framework.browserify]: add bundle to config.files at position 0\r\nINFO [karma]: Karma v0.12.28 server started at http://localhost:9876/\r\nINFO [launcher]: Starting browser PhantomJS\r\nDEBUG [temp-dir]: Creating temp dir at /var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/karma-5759403\r\nDEBUG [launcher]: /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs /var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/karma-5759403/capture.js\r\nDEBUG [watcher]: Excluded file \"/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/karma.conf.js\"\r\nDEBUG [framework.browserify]: building bundle\r\nDEBUG [framework.browserify]: adding hello.spec.js to bundle\r\nDEBUG [framework.browserify]: bundling\r\nINFO [framework.browserify]: 19474 bytes written (0.12 seconds)\r\nINFO [framework.browserify]: bundle built\r\nDEBUG [watcher]: Resolved files:\r\n\t/var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/9409150f6698b81bf6aaf0b28d56eb7f01704769.browserify\r\n\t/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/jasmine.js\r\n\t/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/boot.js\r\n\t/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/adapter.js\r\n\t/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/hello.js\r\n\t/Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/hello.spec.js\r\nDEBUG [web-server]: serving: /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma/static/client.html\r\nDEBUG [web-server]: serving: /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma/static/karma.js\r\nDEBUG [web-server]: upgrade /socket.io/1/websocket/snH5FbsEJtcHVKNbf6AU\r\nDEBUG [karma]: A browser has connected on socket snH5FbsEJtcHVKNbf6AU\r\nINFO [PhantomJS 1.9.8 (Mac OS X)]: Connected on socket snH5FbsEJtcHVKNbf6AU with id 5759403\r\nDEBUG [launcher]: PhantomJS (id 5759403) captured in 2.082 secs\r\nDEBUG [web-server]: serving: /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma/static/context.html\r\nDEBUG [web-server]: serving (cached): /var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/9409150f6698b81bf6aaf0b28d56eb7f01704769.browserify\r\nDEBUG [web-server]: serving (cached): /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/jasmine.js\r\nDEBUG [web-server]: serving (cached): /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/hello.spec.js\r\nDEBUG [web-server]: serving (cached): /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/boot.js\r\nDEBUG [web-server]: serving (cached): /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/node_modules/karma-jasmine/lib/adapter.js\r\nDEBUG [web-server]: serving (cached): /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/hello.js\r\nPhantomJS 1.9.8 (Mac OS X) ERROR\r\n  ReferenceError: Can't find variable: require\r\n  at /Users/magnusorngylfason/Google Drive/Business/Shopping Network/Code/browserifytest/hello.spec.js:1\r\n\r\n\r\nDEBUG [karma]: Run complete, exiting.\r\nDEBUG [launcher]: Disconnecting all browsers\r\nDEBUG [framework.browserify]: cleaning up\r\nDEBUG [launcher]: Process PhantomJS exited with code 0\r\nDEBUG [temp-dir]: Cleaning temp dir /var/folders/qg/r32h5c8s3sb5s4xy6lpthn680000gn/T/karma-5759403\r\n```\r\n\r\nAny ideas? This has been driving my crazy all weekend."},"comment":{"url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/comments/69748049","html_url":"https://github.com/thlorenz/proxyquireify/issues/21#issuecomment-69748049","issue_url":"https://api.github.com/repos/thlorenz/proxyquireify/issues/21","id":69748049,"user":{"login":"bendrucker","id":808808,"avatar_url":"https://avatars.githubusercontent.com/u/808808?v=3","gravatar_id":"","url":"https://api.github.com/users/bendrucker","html_url":"https://github.com/bendrucker","followers_url":"https://api.github.com/users/bendrucker/followers","following_url":"https://api.github.com/users/bendrucker/following{/other_user}","gists_url":"https://api.github.com/users/bendrucker/gists{/gist_id}","starred_url":"https://api.github.com/users/bendrucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendrucker/subscriptions","organizations_url":"https://api.github.com/users/bendrucker/orgs","repos_url":"https://api.github.com/users/bendrucker/repos","events_url":"https://api.github.com/users/bendrucker/events{/privacy}","received_events_url":"https://api.github.com/users/bendrucker/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T14:05:29Z","updated_at":"2015-01-13T14:05:29Z","body":"This is why the advice on the SO post is bad. If you catch a bug in a project and need to hotfix it you should always fork and use a git dep."}}