{"action":"created","issue":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/3467","labels_url":"https://api.github.com/repos/nwjs/nw.js/issues/3467/labels{/name}","comments_url":"https://api.github.com/repos/nwjs/nw.js/issues/3467/comments","events_url":"https://api.github.com/repos/nwjs/nw.js/issues/3467/events","html_url":"https://github.com/nwjs/nw.js/issues/3467","id":75687745,"number":3467,"title":"Window opened in bg-script can't require() relative paths","user":{"login":"polpo","id":1544908,"avatar_url":"https://avatars.githubusercontent.com/u/1544908?v=3","gravatar_id":"","url":"https://api.github.com/users/polpo","html_url":"https://github.com/polpo","followers_url":"https://api.github.com/users/polpo/followers","following_url":"https://api.github.com/users/polpo/following{/other_user}","gists_url":"https://api.github.com/users/polpo/gists{/gist_id}","starred_url":"https://api.github.com/users/polpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polpo/subscriptions","organizations_url":"https://api.github.com/users/polpo/orgs","repos_url":"https://api.github.com/users/polpo/repos","events_url":"https://api.github.com/users/polpo/events{/privacy}","received_events_url":"https://api.github.com/users/polpo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T18:07:51Z","updated_at":"2015-12-29T22:32:55Z","closed_at":null,"body":"I am using `bg-script` in my manifest. In the script file, I open a new NW window with `gui.Window.open()`. In JS code for that window, I do a `require('./reqtest.js');` but get `Error: Cannot find module './reqtest.js'`.\r\n\r\nI've noticed that the URL in the title bar for the new window is `chrome-extension://[random string]/test.html` and in the Sources tab of devtools, my `reqtest.js` file does not exit, either in the [random string] location or (no domain) location.\r\n\r\nI can `require()` a module that is in `node_modules` and that works fine, and the contents of `node_modules` shows up in the (no domain) location in the Sources tab of devtools.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/14495117-window-opened-in-bg-script-can-t-require-relative-paths?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/comments/167892782","html_url":"https://github.com/nwjs/nw.js/issues/3467#issuecomment-167892782","issue_url":"https://api.github.com/repos/nwjs/nw.js/issues/3467","id":167892782,"user":{"login":"snymax","id":7694286,"avatar_url":"https://avatars.githubusercontent.com/u/7694286?v=3","gravatar_id":"","url":"https://api.github.com/users/snymax","html_url":"https://github.com/snymax","followers_url":"https://api.github.com/users/snymax/followers","following_url":"https://api.github.com/users/snymax/following{/other_user}","gists_url":"https://api.github.com/users/snymax/gists{/gist_id}","starred_url":"https://api.github.com/users/snymax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snymax/subscriptions","organizations_url":"https://api.github.com/users/snymax/orgs","repos_url":"https://api.github.com/users/snymax/repos","events_url":"https://api.github.com/users/snymax/events{/privacy}","received_events_url":"https://api.github.com/users/snymax/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T22:32:54Z","updated_at":"2015-12-29T22:32:54Z","body":"I am also experiencing this issue is there any way to pass the node-context on to the newly opened window?"}}