bougarfaoui / ng-socket-io

Socket.IO module for Angular
MIT License
255 stars 57 forks source link

Angular 4 Warning, Error in Angular 5 #40

Closed blended-ideas closed 6 years ago

blended-ideas commented 6 years ago

Hey there, I am using Angular CLI and recently updated it.

I'm receiving the following warning., Warning: Can't resolve all parameters for WrappedSocket in /home/karthik/workspace/clinxapp/node_modules/ng-socket-io/socket-io.service.ts: (?). This will become an error in Angular v5.x

Angular: 4.2.4 Angular CLI: 1.5.2 ng-socket-io: 0.1.11

bougarfaoui commented 6 years ago

please upgrade to latest module : npm i ng-socket-io@0.2.0 --save

orhemi commented 6 years ago

After updating to 5, I get this ERROR:

"ng-socket-io": "^0.2.0" "angular/animations": "^5.0.0", "angular/common": "^5.0.0", "angular/compiler": "^5.0.0", "angular/core": "^5.0.0", "angular/forms": "^5.0.0", "angular/http": "^5.0.0", "angular/platform-browser": "^5.0.0", "angular/platform-browser-dynamic": "^5.0.0", "angular/platform-server": "^5.0.0", "angular/router": "^5.0.0",

ERROR in ./node_modules/ng-socket-io/socket-io.module.ts Module build failed: Error: C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\ng-socket-io\socket-io.module.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:624:23) at plugin.done.then (C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\@ngtools\webpack\src\loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/main/tutorials/tutorials.module.ts 13:0-63 @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts ERROR in ./node_modules/ng-socket-io/socket-io.service.ts Module build failed: Error: C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\ng-socket-io\socket-io.service.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:624:23) at plugin.done.then (C:\Users\orh\Documents\workspace\regudo-admin-client\node_modules\@ngtools\webpack\src\loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./node_modules/ng-socket-io/index.js 5:26-56 @ ./src/app/main/tutorials/tutorial-edit/tutorial-edit.component.ts @ ./src/app/app-routing.module.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

dinozombie commented 6 years ago

Same error using version 0.2.0 with Angular 5.

bougarfaoui commented 6 years ago

a solution was provided here #38

JoelParke commented 6 years ago

I attempted the solution #38. But it does not work for me in a project built from angular-starter. It is a bit strange. Almost all packages work, except a few including 'ng-socket-io' where the build breaks with:

    ERROR in ./node_modules/ng-socket-io/socket-io.module.ts
    Module build failed: Error: /home/joel/workspace/Tracker3/node_modules/ng-socket-io/socket-io.module.ts is not part of the compilation output. Please check the other error messages for details.
        at AngularCompilerPlugin.getCompiledFile (/home/joel/workspace/Tracker3/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:648:23)
        at plugin.done.then (/home/joel/workspace/Tracker3/node_modules/@ngtools/webpack/src/loader.js:467:39)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
     @ ./node_modules/ng-socket-io/index.js 3:25-54
     @ ./src/app/app.module.ts
     @ ./src/app/index.ts
     @ ./src/main.browser.ts

    ERROR in ./node_modules/ng-socket-io/socket-io.service.ts
    Module build failed: Error: /home/joel/workspace/Tracker3/node_modules/ng-socket-io/socket-io.service.ts is not part of the compilation output. Please check the other error messages for details.
        at AngularCompilerPlugin.getCompiledFile (/home/joel/workspace/Tracker3/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:648:23)
        at plugin.done.then (/home/joel/workspace/Tracker3/node_modules/@ngtools/webpack/src/loader.js:467:39)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
     @ ./node_modules/ng-socket-io/index.js 5:26-56
     @ ./src/app/app.module.ts
     @ ./src/app/index.ts
     @ ./src/main.browser.ts

So far I see no way around this issue, but I will report back if I discover one... I would hate to go back to angular4 just so that I could get things to build properly.

toastermagic commented 6 years ago

I got around this by copying socket-io.module.ts, socket-io.service.ts and socketIoConfig.ts into my project and referencing them directly like so:

import { WrappedSocket as Socket } from '../sockets/socket-io.service';

bepehr commented 6 years ago

@toastermagic Can you provide more information please ? Maybe this files sources I`m a starter in angular :)