{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3581","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3581/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3581/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3581/events","html_url":"https://github.com/NativeScript/NativeScript/issues/3581","id":205442106,"number":3581,"title":"Workers do not work in AoT compilated apps","user":{"login":"dxshindeo","id":18443089,"avatar_url":"https://avatars.githubusercontent.com/u/18443089?v=3","gravatar_id":"","url":"https://api.github.com/users/dxshindeo","html_url":"https://github.com/dxshindeo","followers_url":"https://api.github.com/users/dxshindeo/followers","following_url":"https://api.github.com/users/dxshindeo/following{/other_user}","gists_url":"https://api.github.com/users/dxshindeo/gists{/gist_id}","starred_url":"https://api.github.com/users/dxshindeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dxshindeo/subscriptions","organizations_url":"https://api.github.com/users/dxshindeo/orgs","repos_url":"https://api.github.com/users/dxshindeo/repos","events_url":"https://api.github.com/users/dxshindeo/events{/privacy}","received_events_url":"https://api.github.com/users/dxshindeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-02-05T18:10:40Z","updated_at":"2017-02-06T09:54:55Z","closed_at":null,"body":"Steps to reproduce:\r\n1. Create a blank project: `tns create test --ng`\r\n2. Install webpack for AoT support: `npm install --save-dev nativescript-dev-webpack`\r\n3. Create a blank `sockets.js` file next to `app.component.ts`\r\n4. In `app.component.ts` add this line calling a new thread: `var sockets_worker = new Worker('sockets');`\r\n\r\nIt compiles successfully, but when I open the app, it crashes and I get an error:\r\n```\r\nFailed to find module: \"sockets\"\r\n```\r\nThat path worked fine in non-AoT version.\r\nPerhaps, problem lies that this sockets.js file does not get copied/compiled into the project? Because now, when I implemented AoT, no .js file is being generated next to their respective .ts files. I guess that is the idea, because they were not used at all there. And since the sockets.js file is not a ts file, it might not get copied. \r\n\r\nWould like to get a fix on this asap, since it blocks production."},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/277634874","html_url":"https://github.com/NativeScript/NativeScript/issues/3581#issuecomment-277634874","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3581","id":277634874,"user":{"login":"dxshindeo","id":18443089,"avatar_url":"https://avatars.githubusercontent.com/u/18443089?v=3","gravatar_id":"","url":"https://api.github.com/users/dxshindeo","html_url":"https://github.com/dxshindeo","followers_url":"https://api.github.com/users/dxshindeo/followers","following_url":"https://api.github.com/users/dxshindeo/following{/other_user}","gists_url":"https://api.github.com/users/dxshindeo/gists{/gist_id}","starred_url":"https://api.github.com/users/dxshindeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dxshindeo/subscriptions","organizations_url":"https://api.github.com/users/dxshindeo/orgs","repos_url":"https://api.github.com/users/dxshindeo/repos","events_url":"https://api.github.com/users/dxshindeo/events{/privacy}","received_events_url":"https://api.github.com/users/dxshindeo/received_events","type":"User","site_admin":false},"created_at":"2017-02-06T09:54:55Z","updated_at":"2017-02-06T09:54:55Z","body":"JS: An unhandled error occurred in worker: undefined, line: 1 :\r\nJS: Uncaught Error: com.tns.NativeScriptException: Failed to find module: \"globals\", relative to: app/tns_modules/"}}
{"actor":{"display_login":"dxshindeo"}}