Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

346
Vistas
Why I have a typescript error when I run my TU?

I my working on a angular 8 project and have some trouble with TU execution.

When I run my TU with ng test I get this error:

> ng test --progress --browsers ChromeHeadless_custom

10% building 1/1 modules 0 active05 01 2022 16:01:11.191:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
05 01 2022 16:01:11.195:INFO [launcher]: Launching browsers ChromeHeadless_custom with concurrency unlimited
05 01 2022 16:01:11.201:INFO [launcher]: Starting browser ChromeHeadless

ERROR in TypeError: Cannot read property 'lastIndexOf' of undefined
    at Object.startsWith (C:\Users\e12404\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:1914:20)
    at isPathRelativeToParent (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93723:23)
    at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93682:24
    at Object.firstDefined (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:295:26)
    at getPathRelativeToRootDirs (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93680:23)
    at tryGetModuleNameFromRootDirs (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93553:40)
    at getLocalModuleSpecifier (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93422:44)
    at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93409:96
    at Array.map (<anonymous>)
    at Object.getModuleSpecifiers (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93409:57)
    at getSpecifierForModuleSymbol (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35318:62)
    at createExpressionFromSymbolChain (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35434:49)
    at symbolToExpression (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35429:24)
    at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34427:106
    at withContext (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34456:37)
    at symbolToExpression (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34427:28)

npm ERR! Test failed.  See above for more details.

See console output

The project builds with no error. So maybe it's a problem in my tests.

I saw similar problems but it was about vscode typescript parser or about a typescript bug.

I have the same error with typescript@3.5.3 and typescript@4.5.0

Do you have any ideas ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda