{"action":"opened","issue":{"url":"https://api.github.com/repos/gopherjs/gopherjs/issues/157","labels_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/157/comments","events_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/157/events","html_url":"https://github.com/gopherjs/gopherjs/issues/157","id":54272455,"number":157,"title":"Node's require fails on testing","user":{"login":"hajimehoshi","id":16950,"avatar_url":"https://avatars.githubusercontent.com/u/16950?v=3","gravatar_id":"","url":"https://api.github.com/users/hajimehoshi","html_url":"https://github.com/hajimehoshi","followers_url":"https://api.github.com/users/hajimehoshi/followers","following_url":"https://api.github.com/users/hajimehoshi/following{/other_user}","gists_url":"https://api.github.com/users/hajimehoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/hajimehoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hajimehoshi/subscriptions","organizations_url":"https://api.github.com/users/hajimehoshi/orgs","repos_url":"https://api.github.com/users/hajimehoshi/repos","events_url":"https://api.github.com/users/hajimehoshi/events{/privacy}","received_events_url":"https://api.github.com/users/hajimehoshi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-14T01:19:54Z","updated_at":"2015-01-14T01:19:54Z","closed_at":null,"body":"e.g. After installing gl library like this\r\n\r\n```\r\nnpm install --global gl\r\n```\r\n\r\n, execute this:\r\n\r\n```go\r\npackage foo_test\r\n\r\nimport (\r\n        \"github.com/gopherjs/gopherjs/js\"\r\n        \"testing\"\r\n)\r\n\r\nfunc TestFoo(t *testing.T) {\r\n        gl := js.Global.Call(\"require\", \"gl\")\r\n        print(gl)\r\n}\r\n```\r\n```\r\ngopherjs test\r\n```\r\n\r\n, failing with this message:\r\n```\r\n--- FAIL: TestFoo (0.01s)\r\nfatal error: all goroutines are asleep - deadlock!\r\n\r\n/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:1454\r\n        throw err;\r\n              ^\r\nJavaScript error: Cannot find module 'gl'\r\n    at Function.Module._resolveFilename (module.js:338:15)\r\n    at Function.Module._load (module.js:280:25)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\n    at $packages._/Users/hajimehoshi/tmp/test_test.$pkg.TestFoo [as F2] (/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:17293:16)\r\n    at $blocking_F (/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:16266:13)\r\n    at $blocking_tRunner (/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:16958:83)\r\n    at goroutine (/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:1442:19)\r\n    at null._onTimeout (/private/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/test.118546901:1498:9)\r\n    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)\r\nFAIL    _/Users/hajimehoshi/tmp/test    0.212s\r\n```\r\n\r\nWith regular ``gopherjs build`` and ``node``, ``require`` worked."}}