{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/1278","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/1278/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/1278/events","html_url":"https://github.com/angular/angular-cli/issues/1278","id":163737766,"number":1278,"title":"Import 3rd Party Library (Socket.io)","user":{"login":"chrislow","id":5181596,"avatar_url":"https://avatars.githubusercontent.com/u/5181596?v=3","gravatar_id":"","url":"https://api.github.com/users/chrislow","html_url":"https://github.com/chrislow","followers_url":"https://api.github.com/users/chrislow/followers","following_url":"https://api.github.com/users/chrislow/following{/other_user}","gists_url":"https://api.github.com/users/chrislow/gists{/gist_id}","starred_url":"https://api.github.com/users/chrislow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrislow/subscriptions","organizations_url":"https://api.github.com/users/chrislow/orgs","repos_url":"https://api.github.com/users/chrislow/repos","events_url":"https://api.github.com/users/chrislow/events{/privacy}","received_events_url":"https://api.github.com/users/chrislow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-04T20:07:04Z","updated_at":"2016-07-27T02:56:20Z","closed_at":"2016-07-27T02:56:20Z","body":"    angular-cli: 0.0.39 \r\n    node: 6.2.2 \r\n    os: win32 x64\r\n\r\nI tried to import [socket.io-client][1] into an angular2 app generated with the [angular-cli][2] but i can't get it to work.\r\n\r\n**Error and stacktrace**\r\n\r\n    Error: Typescript found the following errors:\r\n      C:/Users/Christian/Desktop/prototypes/chat-client/tmp/broccoli_type_script_compiler-input_base_path-5WNagLgm.tmp/0/src/app/chat.component.ts (4, 21): Cannot find module 'socket.io-client'.\r\n        at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\lib\\broccoli\\broccoli-typescript.js:115:19)\r\n        at BroccoliTypeScriptCompiler.build (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\lib\\broccoli\\broccoli-typescript.js:43:10)\r\n        at C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\node_modules\\broccoli-caching-writer\\index.js:152:21\r\n        at lib$rsvp$$internal$$tryCatch (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\node_modules\\broccoli-caching-writer\\node_modules\\rsvp\\dist\\rsvp.js:1036:16)\r\n        at lib$rsvp$$internal$$invokeCallback (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\node_modules\\broccoli-caching-writer\\node_modules\\rsvp\\dist\\rsvp.js:1048:17)\r\n        at lib$rsvp$$internal$$publish (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\node_modules\\broccoli-caching-writer\\node_modules\\rsvp\\dist\\rsvp.js:1019:11)\r\n        at lib$rsvp$asap$$flush (C:\\Users\\Christian\\Desktop\\prototypes\\chat-client\\node_modules\\angular-cli\\node_modules\\broccoli-caching-writer\\node_modules\\rsvp\\dist\\rsvp.js:1198:9)\r\n        at _combinedTickCallback (internal/process/next_tick.js:67:7)\r\n        at process._tickCallback (internal/process/next_tick.js:98:9)\r\n\r\n**chat.component.ts**\r\n\r\n    import * as io from \"socket.io-client\";\r\n    \r\n    @Component({\r\n      ...\r\n    })\r\n    export class ChatAppComponent {\r\n      ...\r\n    }\r\n\r\n**system-config.ts**\r\n    \r\n    /** Map relative paths to URLs. */\r\n    const map: any = {\r\n        \"socket.io-client\": \"vendor/socket.io-client/socket.io.js\"\r\n    };\r\n    \r\n    /** User packages configuration. */\r\n    const packages: any = {\r\n        \"socket.io-client\": {\"defaultExtension\": \"js\"}\r\n    };\r\n\r\n**angular-cli-build.js**\r\n\r\n    var Angular2App = require('angular-cli/lib/broccoli/angular2-app');\r\n    \r\n    module.exports = function(defaults) {\r\n      return new Angular2App(defaults, {\r\n        vendorNpmFiles: [\r\n          'systemjs/dist/system-polyfills.js',\r\n          'systemjs/dist/system.src.js',\r\n          'zone.js/dist/*.js',\r\n          'es6-shim/es6-shim.js',\r\n          'reflect-metadata/*.js',\r\n          'rxjs/**/*.js',\r\n          '@angular/**/*.js',\r\n          'socket.io-client/socket.io.js'\r\n        ]\r\n      });\r\n    };\r\n\r\n**package.json**\r\n\r\n    {\r\n          \"dependencies\": {\r\n            ...\r\n            \"socket.io-client\": \"^1.4.8\",\r\n            \"systemjs\": \"0.19.26\"\r\n          },\r\n          \"devDependencies\": {\r\n            ...\r\n            \"typescript\": \"^1.8.10\",\r\n            \"typings\": \"\r\n          }\r\n    }\r\n\r\n**typings.json**\r\n\r\n    {\r\n      \"ambientDevDependencies\": {\r\n        \"angular-protractor\": \"registry:dt/angular-protractor#1.5.0+20160425143459\",\r\n        \"jasmine\": \"registry:dt/jasmine#2.2.0+20160412134438\",\r\n        \"selenium-webdriver\": \"registry:dt/selenium-webdriver#2.44.0+20160317120654\"\r\n      },\r\n      \"ambientDependencies\": {\r\n        \"es6-shim\": \"registry:dt/es6-shim#0.31.2+20160317120654\",\r\n      },\r\n      \"globalDependencies\": {\r\n        \"socket.io-client\": \"registry:dt/socket.io-client#1.4.4+20160317120654\"\r\n      }\r\n    }\r\n\r\n  [1]: http://socket.io/\r\n  [2]: https://github.com/angular/angular-cli"}}
{"actor":{"display_login":"filipesilva"}}