{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node-addon-api/issues/269","repository_url":"https://api.github.com/repos/nodejs/node-addon-api","labels_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/269/comments","events_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/269/events","html_url":"https://github.com/nodejs/node-addon-api/issues/269","id":322903982,"node_id":"MDU6SXNzdWUzMjI5MDM5ODI=","number":269,"title":"N-api builds not cross runtime on windows","user":{"login":"jpkolbush","id":17112993,"node_id":"MDQ6VXNlcjE3MTEyOTkz","avatar_url":"https://avatars3.githubusercontent.com/u/17112993?v=4","gravatar_id":"","url":"https://api.github.com/users/jpkolbush","html_url":"https://github.com/jpkolbush","followers_url":"https://api.github.com/users/jpkolbush/followers","following_url":"https://api.github.com/users/jpkolbush/following{/other_user}","gists_url":"https://api.github.com/users/jpkolbush/gists{/gist_id}","starred_url":"https://api.github.com/users/jpkolbush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpkolbush/subscriptions","organizations_url":"https://api.github.com/users/jpkolbush/orgs","repos_url":"https://api.github.com/users/jpkolbush/repos","events_url":"https://api.github.com/users/jpkolbush/events{/privacy}","received_events_url":"https://api.github.com/users/jpkolbush/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-05-14T17:09:31Z","updated_at":"2018-11-10T17:12:59Z","closed_at":null,"author_association":"NONE","body":"* **Node Version**: 8.9.4\r\n* **Platform**: Windows\r\n* **Compiler**: MSVC 15\r\n\r\n\r\nI was led to believe that the new n-api was not only going to be compatible across all node runtimes, but also going to be compatible when building a native module for node vs building for electron. \r\nIf you build the basic hello-world example for n-api found [here](https://nodejs.org/api/addons.html#addons_n_api), the `addon.node` file cannot be required when running from the electron runtime. I get the following error:\r\n\r\n```\r\nA dynamic link library (DLL) initialization routine failed.\r\n\\\\?\\C:\\Users\\kelannen\\source\\napi-test\\build\\Release\\addon.node\r\nError: A dynamic link library (DLL) initialization routine failed.\r\n\\\\?\\C:\\Users\\kelannen\\source\\napi-test\\build\\Release\\addon.node\r\n    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)\r\n    at Object.Module._extensions..node (module.js:671:18)\r\n    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)\r\n    at Module.load (module.js:561:32)\r\n    at tryModuleLoad (module.js:504:12)\r\n    at Function.Module._load (module.js:496:3)\r\n    at Module.require (module.js:586:17)\r\n    at require (internal/module.js:11:18)\r\n    at Object.<anonymous> (C:\\Users\\kelannen\\source\\napi-test\\test.js:2:15)\r\n    at Object.<anonymous> (C:\\Users\\kelannen\\source\\napi-test\\test.js:6:3)\r\n    at Module._compile (module.js:642:30)\r\n    at Object.Module._extensions..js (module.js:653:10)\r\n    at Module.load (module.js:561:32)\r\n    at tryModuleLoad (module.js:504:12)\r\n    at Function.Module._load (module.js:496:3)\r\n    at Module.require (module.js:586:17)\r\n    at require (internal/module.js:11:18)\r\n    at C:\\Users\\kelannen\\source\\napi-test\\node_modules\\mocha\\lib\\mocha.js:253:27\r\n    at Array.forEach (<anonymous>)\r\n    at Mocha.loadFiles (C:\\Users\\kelannen\\source\\napi-test\\node_modules\\mocha\\lib\\mocha.js:250:14)\r\n    at Mocha.run (C:\\Users\\kelannen\\source\\napi-test\\node_modules\\mocha\\lib\\mocha.js:577:10)\r\n    at Object.run (C:\\Users\\kelannen\\source\\napi-test\\node_modules\\electron-mocha\\mocha.js:54:30)\r\n    at App.app.on (C:\\Users\\kelannen\\source\\napi-test\\node_modules\\electron-mocha\\index.js:54:13)\r\n    at emitTwo (events.js:131:20)\r\n    at App.emit (events.js:214:7)\r\n```\r\n\r\nI set up a basic test here:\r\n\r\nhttps://github.com/jpkolbush/napi-test\r\n\r\nSteps to reproduce:\r\n```\r\nnpm install\r\n\r\n#runs node-gyp configure-build\r\nnpm run build\r\n\r\n#confirms that the module can be included with node runtime\r\nnode test.js\r\n\r\n#requires the node module while running electron-mocha, this command will fail\r\nnpm run electron-test\r\n```\r\n\r\nThis is only an issue on Windows, does not appear on Unix.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node-addon-api/issues/comments/437599379","html_url":"https://github.com/nodejs/node-addon-api/issues/269#issuecomment-437599379","issue_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/269","id":437599379,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzU5OTM3OQ==","user":{"login":"refack","id":96947,"node_id":"MDQ6VXNlcjk2OTQ3","avatar_url":"https://avatars3.githubusercontent.com/u/96947?v=4","gravatar_id":"","url":"https://api.github.com/users/refack","html_url":"https://github.com/refack","followers_url":"https://api.github.com/users/refack/followers","following_url":"https://api.github.com/users/refack/following{/other_user}","gists_url":"https://api.github.com/users/refack/gists{/gist_id}","starred_url":"https://api.github.com/users/refack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refack/subscriptions","organizations_url":"https://api.github.com/users/refack/orgs","repos_url":"https://api.github.com/users/refack/repos","events_url":"https://api.github.com/users/refack/events{/privacy}","received_events_url":"https://api.github.com/users/refack/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T17:12:59Z","updated_at":"2018-11-10T17:12:59Z","author_association":"MEMBER","body":"I have a hunch it's related to https://github.com/nodejs/node-gyp/pull/1566.\r\nI'm verifying now."}}
{"actor":{"display_login":"refack"}}