ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

New created ng7-pre Project fails to compile due to directory with hashtag #483

Closed HackXIt closed 5 years ago

HackXIt commented 5 years ago

I'm submitting a...

Current behavior

After finished Execution of 'ng new ng7-pre' inside a directory involving '#' in the path, the project fails to compile because the directory cannot resolve the modules.

Expected behavior

「wdm」: Compiled successfully.

Minimal reproduction of the problem with instructions

Create a folder including the hashtag character. For example #Sample-Project Inside the folder execute ng new ng7-pre Angular Routing? Yes Stylesheet format? Sass

Inside the .\ng7-pre\ folder execute npm start

Environment

Windows 10 x64



PS D:\#Sample-Project\ng7-pre> npm start

> ng7-pre@0.0.0 start D:\#Sample-Project\ng7-pre
> ng serve

Date: 2019-06-17T12:59:05.983Z
Hash: 1f917eb32c0676678e1a
Time: 3718ms
chunk {main} main.js, main.js.map (main) 1.88 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 119 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.3 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 327 kB [initial] [rendered]

ERROR in Could not resolve module D:/
ERROR in ./src/styles.sass (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--13-3!./src/styles.sass)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Unsupported operation: Cannot extract a file path from a URI with a fragment component
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
i 「wdm」: Failed to compile.

Others:

sinedied commented 5 years ago

This issue should posted to angular/cli repository, there is nothing we can do here about it.

As a general good practice though, spaces and special characters should be avoided in paths on Windows as they often cause issues on this platform.