I am working on a project that is using 1.0 of angular-cli and I am trying to include socket.io into that project. However, I am faced with the following errors and I am not sure how to get around them.
Module not found: Error: Can't resolve 'socket.io-client/package'
There is a warning before this error is shown referring to an unexpected token from a socket.io file namely socket.io.js.map. When I look at this file it appears to be a JSON file.
Module parse failed: D:\madlink-test-app\madlink-dongle-app-two\node_modules\socket.io-client\dist\socket.io.js.map Unexpected token (1:10) You may need an appropriate loader to handle this file type.
According to this question it seems that I need json-loader, but from what I can tell this is included automatically when using angular-cli. Any advice that is offered for this problem would be greatly appreciated.
angular-cli version: 1.0.0
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}