Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#24,855 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, cypress, typescript, webpack

Rechercherichtung

Reproduziere den Fehler mit npx cypress open im verlinkten Repository und untersuche anschließend tsconfig.app.json, cypress.config.ts sowie den von @ngtools/webpack gemeldeten Angular-Build-Pfad. Überprüfe, wie die Cypress-Komponentendatei für die TypeScript-Kompilierung ausgewählt wird. Erledigt ist die Aufgabe, wenn der Komponententest ohne den Fehler „fehlt in der Kompilierung“ geöffnet wird, sobald die Cypress-Dateien über include angegeben werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
17 Std. 25 Min.
Gemergte PRs (30 T.)
183

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus angular/angular-cli

Alle Issues in angular/angular-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.