Closed ghost closed 6 years ago
ng serve --aot
works
Make sure your tsconfig.json file looks like this:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": [
"src/**/*",
"node_modules/ng-socket-io/index.ts"
]
}
Add the index.ts file of ng-socket-io to the includes section of the file, works perfectly
At first it wasn't working for me, but then I noticed that I needed to restart the webserver so it compiles completely. Thanks.
The problem with this is that the library is incorrectly packaged. Libraries should never ship their ts files. Here's a very good explanation, I hope you can update the library accordingly as it is really helpful and should be coded properly:
https://github.com/angular/angular-cli/issues/8284#issuecomment-341417325
If this isn't updated properly even the way of including the index.ts file will break in the future. This is absolutely mandatory.
@Vxrize I published a new version ng-socket-io@0.2.3
as you said, I tested it in JIT and Aot and it works just fine on both Angular and Ionic. Many thanks.
Great, I will test it out!
(I'm using last version 0.2.0 of ng-socket-io)
Since I update to angular5 and angular-cli 1.5, I have this error when starting my app: