x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Not that I know off
A clear and concise description of the problem...
When running ng build via Jenkins on Windows, paths defined in angular.jsons assets does not get included.
The root cause of the issue seems to be with brackets ( & ) in the path. Using Process Monitor, i found the paths called where not found.
They look like this:
C:\Program Files [(]x86[)]\Jenkins\workspace\Uti...
Create folder: C:\test (x86)\
Open CMD (admin elevated)
Run commands:
cd "C:\text (x86)\"
ng new helloworld
cd helloworld
ng build --aot
None in the CLI, neither in normal or verbose mode
Angular CLI: 8.0.6
Node: 10.15.3
OS: win32 x64
Angular: 8.1.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.6
@angular-devkit/build-angular 0.800.6
@angular-devkit/build-optimizer 0.800.6
@angular-devkit/build-webpack 0.800.6
@angular-devkit/core 8.0.6
@angular-devkit/schematics 8.0.6
@angular/cdk 8.0.2
@angular/cli 8.0.6
@angular/fire 5.2.1
@angular/material 8.0.2
@ngtools/webpack 8.0.6
@schematics/angular 8.0.6
@schematics/update 0.800.6
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
Anything else relevant?
OS: Window Server 2016
H @cf-jolai I just looked at this and I am not able to replicate your problem.
Here's what I did:
$ mkdir "Foo (x8)"
$ cd "Foo (x8)"
$ ng new test
$ cd test
$ ng build
$ ls dist\test\ | grep favicon.ico
favicon.ico // assets have been copied succesfully
Note: I tried this on a windows machine.
The assets are defined like this:
"assets": [
"src/web.config",
"src/assets"
],
and there's no errors visible in the console, not even with verbose.
Only found the errors by checking the node process events.
For replication:
OS: Windows Server 2016
Path: C:\test (x86)\
Open CMD (admin elevated)
Run commmands:
cd "C:\text (x86)\"
ng new helloworld
cd helloworld
ng build --aot
I'll update the OP with this info too.
Thanks for your prompt reply. I managed to replicate the issue using git bash.
Also related to https://github.com/angular/angular-cli/issues/15058
As stated in this comment, the bug only seems to occur, if the folder directly under C:\ contains a bracket.
So a project under C:\b(r)acket will be affected by the bug, while a project under C:\test\b(r)acket won't be affected.
Unfortunately this is the case for Program Files (x86) on windows systems.
Also seeing the behavior, causing an issue with Jenkins builds.
Agreed -- hit this problem today whilst migrating builds from one server to another. The worst part, it silently fails so you think the build works instead of just exploding so you know something is wrong!
Most helpful comment
Agreed -- hit this problem today whilst migrating builds from one server to another. The worst part, it silently fails so you think the build works instead of just exploding so you know something is wrong!