Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.2K
Views
ERROR en TypeError: no se puede leer la propiedad 'flags' de indefinido

Tengo un problema cuando intento ejecutar ng serve en un proyecto Angular creado recientemente. La versión que estoy usando es 9.1.4, este error no ocurre en un proyecto con una versión anterior de Angular.

 Package Version ----------------------------------------------------------- @angular-devkit/architect 0.901.4 @angular-devkit/build-angular 0.901.4 @angular-devkit/build-optimizer 0.901.4 @angular-devkit/build-webpack 0.901.4 @angular-devkit/core 9.1.4 @angular-devkit/schematics 9.1.4 @angular/cli 9.1.4 @ngtools/webpack 9.1.4 @schematics/angular 9.1.4 @schematics/update 0.901.4 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0

Después de ejecutar ng serve o ng build :

 chunk {main} main.js, main.js.map (main) 2 kB [initial] [rendered]<br> chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 679 bytes [initial] [rendered]<br> chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]<br> chunk {styles} styles.js, styles.js.map (styles) 12.4 kB [initial] [rendered]<br> chunk {vendor} vendor.js, vendor.js.map (vendor) 339 kB [initial] [rendered]<br> Date: 2020-05-08T02:06:46.145Z - Hash: 1a1b937f0ca2bb37634b - Time: 4087ms<br> **ERROR in TypeError: Cannot read property 'flags' of undefined** at resolveAlias (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:36513:37) at checkAliasSymbol (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64502:26) at checkImportBinding (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64534:13) at checkImportDeclaration (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64552:29) at checkSourceElementWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64961:28) at checkSourceElement (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64800:17) at Object.forEach (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:317:30) at checkSourceFileWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65123:20) at checkSourceFile (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65091:13) at getDiagnosticsWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65179:17) at Object.getDiagnostics (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65165:24) at C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98703:85 at runWithCancellationToken (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98665:24) at getBindAndCheckDiagnosticsForFileNoCache (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98691:20) at getAndCacheDiagnostics (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98956:26) at getBindAndCheckDiagnosticsForFile (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98688:20) ** **Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/** **

El resultado que obtengo en mi navegador después de ejecutar este proyecto es:

 Cannot GET /
over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

Tengo el mismo problema al actualizar de 10.1.0 a 11.1.1.

Actualizar TypeScript a la última versión de 4.0.2 a 4.1.3 resolvió el problema:

npm i typescript@latest

over 4 years ago · Santiago Trujillo Report

0

prueba esta solución:

 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4 npm install ng serve
over 4 years ago · Santiago Trujillo Report

0

editar

Si usa angular 9.1.6, debería estar bien ahora

 npm update @angular/cli @angular/core

publicación original

Algo está roto en Angular 9.1.5: si ejecuta lo siguiente, debería funcionar:

 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4 ng build

Acabo de pasar alrededor de 4-5 horas tratando de arreglarlo yo mismo...

El problema parece provenir del uso de Angular CLI 9.1.4 con Angular 9.1.5 (lo más probable es que el compilador

Verás el problema cuando lo hagas.

 ng --version

Si lo consigues:

 Angular CLI: 9.1.4 Node: 12.16.3 OS: win32 x64 Angular: 9.1.5 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes

Luego, deberá seguir las instalaciones de npm que enumeré anteriormente

over 4 years ago · Santiago Trujillo Report

0

La respuesta de @ Matt funcionó para mí también para ng serve , pero necesitaba pasos adicionales. Primero haga estos pasos "Citando los pasos de su respuesta":

  1. Primero verifique ng --version . Vaya al siguiente paso si obtiene:
 Angular CLI: 9.1.4 Node: 12.16.3 OS: win32 x64 Angular: 9.1.5 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes
  1. Fuerce la reinstalación de los paquetes angulares con 9.1.4 como versión usando:
 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4

Un par de pasos más para que más ng serve para finalmente funcionar.

  1. El siguiente error que recibí fue sobre tslib: se An unhandled exception occurred: Cannot find module 'tslib' Para esto, instalé el paquete tslib manualmente usando npm.
  2. El siguiente error que recibí fue You seem to not be depending on "@angular/core" and/or "rxjs". This is an error. . Para esto me refería "Parece que no dependes de" @ angular / core ". ¡y voilá! ng servir funcionó!
over 4 years ago · Santiago Trujillo Report

0

9.1.6 recién lanzado, debería solucionar ese problema

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!