Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

tsconfig.app.json 'includes' does not respect glob patterns for cypress

Abierto
#24,855 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
angular, cypress, typescript, webpack

Línea de trabajo

Reproduce el fallo con npx cypress open en el repositorio enlazado y, a continuación, inspeccione tsconfig.app.json, cypress.config.ts y la ruta de compilación de Angular indicada por @ngtools/webpack. Verifique cómo se selecciona el archivo de componente de Cypress para la compilación de TypeScript. Se considera hecho cuando la prueba de componentes se abre sin el error de que falta en la compilación al especificar los archivos de Cypress mediante include.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area: @ngtools/webpack needs: investigation
Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

I've included a link to repo that provides the basic setup. To test the issue, you just need to run npx cypress open with the setup I've created, then click on 'component tests'. Now click on 'app.ts'. The error is provided below - essentially it's asking me to include the app.ts file in either the 'files' or 'include' property of the tsconfig.

This is what works when added to tsconfig.app.json:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "cypress/component/app.ts"
  ],
  "include": [
    "src/**/*.d.ts",
  ]
}

This is what fails when added to tsconfig.app.json:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
  ],
  "include": [
    "src/**/*.d.ts",
    "cypress/**/*.ts",
  ]
}

I checked multiple sources, and cannot see any error in the cypress glob pattern added to include.

Note, this also fails:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
  ],
  "include": [
    "src/**/*.d.ts",
    "cypress/component/app.ts"
  ]
}

It appears to be a bug - I can't define it in any other terms at this point, as it's a basic example, applied to a boilerplate Angular application, with virtually no additions/tweaks outside of the this app.ts test.

Please provide a link to a minimal reproduction of the bug

https://github.com/CMadden8/cypress-angular-test

Please provide the exception or error you saw
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):

Error: C:\[omitted path]\cypress\component\app.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 15.2.2
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64

Angular: 15.2.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.2
@angular-devkit/build-angular   15.2.2
@angular-devkit/core            15.2.2
@angular-devkit/schematics      15.2.2
@schematics/angular             15.2.2
rxjs                            7.8.0
typescript                      4.9.5
Anything else?

@badeball/cypress-cucumber-preprocessor and ts-loader were installed alongside cypress, and configured for component testing within cypress.config.ts

Lenguaje dominante
TypeScript
Estrellas
27k
Forks
11.8k
Merge medio
16 h 35 min
PR fusionados (30 d)
176

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angular/angular-cli

Todos los issues de angular/angular-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.