Bonjour !
J'ai un soucis avec cette erreur, dans le fonctionnement du framework je ne comprends pas comment la résoudre:
le problème actuellement est avec ce TypeScript:Error: Can’t resolve all parameters for SocketRasp: (?).
at syntaxError (http://localhost:8100/build/vendor.js:80840:34)
at CompileMetadataResolver._getDependenciesMetadata (http://localhost:8100/build/vendor.js:94915:35)
at CompileMetadataResolver._getTypeMetadata (http://localhost:8100/build/vendor.js:94783:26)
at CompileMetadataResolver._getInjectableMetadata (http://localhost:8100/build/vendor.js:94769:21)
at CompileMetadataResolver.getProviderMetadata (http://localhost:8100/build/vendor.js:95060:40)
at http://localhost:8100/build/vendor.js:94989:49
at Array.forEach ()
at CompileMetadataResolver._getProvidersMetadata (http://localhost:8100/build/vendor.js:94949:19)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/vendor.js:94604:50)
at JitCompiler._loadModules (http://localhost:8100/build/vendor.js:105945:70)
Mais il me le fait aussi avec un autre selon ce que je lui place en paramètre.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import { NgModule, Injectable } from '@angular/core'; import { Socket } from 'ngx-socket-io'; @Injectable() export class SocketRasp extends Socket { ipAddress: String; constructor(ipAddress: String) { super({ url: 'http://'+ ipAddress + ':8080', options: {} }); //Port can be placed in ipAddress, think to delete it, in that case } //getters //setters //methods }
Je rajoute mon app.module.ts et le package.json
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 import { NgModule, ErrorHandler } from '@angular/core'; import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; import { BrowserModule } from '@angular/platform-browser'; import { MyApp } from './app.component'; import { HttpClientModule } from '@angular/common/http'; import { SocketIoModule } from 'ngx-socket-io'; //pages import { viewerPage } from '../pages/viewer/viewer'; import { HomePage } from '../pages/home/home'; import { SocketRasp } from '../assets/typescript/SocketRasp'; @NgModule({ declarations: [ MyApp, HomePage, viewerPage ], imports: [ IonicModule.forRoot(MyApp), HttpClientModule, BrowserModule, SocketIoModule ], bootstrap: [IonicApp], entryComponents: [ MyApp, HomePage, viewerPage ], providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }, SocketRasp] //{ provide: "_IP_ADDRESS_", useValue: "169.254.25.25" /*your ip address*/ }, }) export class AppModule {}Après pas mal de recherche peu fructueuse, beaucoup parle d'update de package, mais si c'est le cas je ne vois pas quoi ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 { "name": "io.cordova.myapp6ab750", "author": "", "homepage": "", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve", "watch": "ionic-app-scripts watch" }, "dependencies": { "@angular/common": "4.3.5", "@angular/compiler": "4.3.5", "@angular/compiler-cli": "4.3.5", "@angular/core": "4.3.5", "@angular/forms": "4.3.5", "@angular/http": "4.3.5", "@angular/platform-browser": "4.3.5", "@angular/platform-browser-dynamic": "4.3.5", "@ionic-native/core": "4.1.0", "@ionic-native/splash-screen": "4.1.0", "@ionic-native/status-bar": "4.1.0", "@ionic/storage": "2.0.1", "ionic-angular": "3.6.0", "ionicons": "3.0.0", "rxjs": "5.4.3", "socket.io": "^2.0.4", "sw-toolbox": "3.6.0", "zone.js": "0.8.16" }, "devDependencies": { "@ionic/app-scripts": "2.1.4", "typescript": "2.3.4" }, "description": "Ionic2Blank: An Ionic project", "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-console", "cordova-plugin-statusbar", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard" ], "cordovaPlatforms": [], "-vs-binding": { "BeforeBuild": [ "ionic:build" ] } }
En tout cas, j'espère que vous serez en mesure de m'aider !
Partager