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

Check pathnames for illegal characters (e.g. outputPath for build files)

Offen
#19,533 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
build-system, cli

Rechercherichtung

Beginne damit, den Befehl ng build mit auf .../dist gesetztem outputPath in einer Windows-Sandbox zu reproduzieren, wobei du die im Issue beschriebene angular.json-Konfiguration verwendest. Verfolge, wie der Build diesen Pfad verarbeitet, und überprüfe, dass ein ungültiger Pfadname eine Warnung oder einen Fehler erzeugt, bevor Dateien oder Verzeichnisse erstellt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area: @angular-devkit/build-angular feature feature: insufficient votes

🐞 Bug report

Command (mark with an x)
  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc
Description

The Angular CLI should warn the user if a specified path is invalid for the current system.

I accidently set ".../dist" (three dots) as outputPath in angular.json. Correct is "../dist" (two dots). Running ng build created a huge mess. In the app root a folder has been created with ... as name (ending a folder name in Windows with a dot is illegal). Inside of this three dot folder all of my project files were listed (including node_modules folder). There was also a folder named ..., which again contained my whole project files. This recursively went to whatever level (I clicked throuhg the folder approximately 30 levels down, there was still a ... folder). Deleting the first ... folder lastet more than 15 minutes, then telling me the files which should be deleted aren't there anymore. Also my project files in the root directory were deleted in this process (luckily most of it in Git). That was the strangest thing, it felt like the content inside of ... mirrored my root project somehow (like in https://superuser.com/questions/528502/cant-remove-three-dots-folder-on-my-hdd). I also tried reverting my files using Git which did not work at all. I managed to delete the whole repository locally with rm -rf 'folder' using the GitBash. After cloning the project again, my IDE (Webstorm) listed the ... folder once again, which luckily could be deleted this time. The project looks fine right now, and with the correct outputPath the app builds correctly.

It would be nice if the CLI checks pathnames for illegal characters. I did not try any other illegal characters inside of the path name.

🔬 Minimal Reproduction

Caution: Try in a sandbox environment with unimported files only to prevent loss of data!

  1. Change the "outputPath" in angular.json to ".../dist" (three dots)
  2. Run ng build

🌍 Your Environment




Angular CLI: 11.0.1
Node: 14.15.0
OS: win32 x64

Angular: 11.0.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.1
@angular-devkit/build-angular   0.1100.1
@angular-devkit/core            11.0.1
@angular-devkit/schematics      11.0.1
@angular/cdk                    11.0.1
@angular/cli                    11.0.1
@angular/material               11.0.1
@schematics/angular             11.0.1
@schematics/update              0.1100.1
rxjs                            6.6.3
typescript                      4.0.5

Anything else relevant?

ng build gone wrong

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.