Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#19,533 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
angular, typescript
Domaine
build-system, cli

Piste de recherche

Commencez par reproduire la commande ng build avec outputPath défini sur .../dist dans un environnement de test Windows, en utilisant la configuration angular.json décrite dans l’issue. Suivez la manière dont le build traite ce chemin et vérifiez qu’un nom de chemin non valide produit un avertissement ou une erreur avant la création de fichiers ou de répertoires.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
17 h 25 min
PR mergées (30 j)
183

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de angular/angular-cli

Toutes les issues de angular/angular-cli

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.