1
resposta

Erro ao subir o serve, algo a ver com HttpClient

Olá,

Alguém poderia me ajudar com o seguinte erro? Ao rodar o comando no prompt "ng serve --open" aparece o seguinte erro.

chunk {main} main.js, main.js.map (main) 2 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 679 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 926 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 341 kB [initial] [rendered]
Date: 2020-08-15T18:45:27.372Z - Hash: da2ca118c82ace7ba3df - Time: 19554ms

ERROR in node_modules/@angular/common/http/http.d.ts:81:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@angular/common/http) which declares HttpClient has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

81 export declare class HttpClient {
                        ~~~~~~~~~~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
1 resposta

Fala ai Santos, tudo bem? Tente parar o servidor e rodar um npm ci, isso vai limpar e atualizar o node_modules.

Feito isso, tente subir novamente.

Espero ter ajudado.