Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng e2e does not serve assets in 9.0.0-next.9 #15825

Closed
cexbrayat opened this issue Oct 12, 2019 · 2 comments · Fixed by #15830
Closed

ng e2e does not serve assets in 9.0.0-next.9 #15825

cexbrayat opened this issue Oct 12, 2019 · 2 comments · Fixed by #15830

Comments

@cexbrayat
Copy link
Member

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [x] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.0.0-next.8

Description

The assets are not served in e2e tests, leading to errors in the console and failing e2e task.

🔬 Minimal Reproduction

This is fairly straightforward to repro:

npx @angular/cli@9.0.0-next.9 new e2e-assets --defaults
# update app.component.html to add something from src/assets like an image
ng e2e

I put together a small repro: https://github.com/cexbrayat/e2e-assets

🔥 Exception or Error


1) workspace-project App should display welcome message
  - Expected [ Entry({ level: SEVERE, message: 'http://localhost:4200/assets/angular-logo.png - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1570866850657, type: '' }), Entry({ level: SEVERE, message: 'http://localhost:4200/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1570866850671, type: '' }) ] not to contain .

🌍 Your Environment


Angular CLI: 9.0.0-next.9
Node: 12.7.0
OS: darwin x64
Angular: 9.0.0-next.10
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-next.9
@angular-devkit/build-angular     0.900.0-next.9
@angular-devkit/build-optimizer   0.900.0-next.9
@angular-devkit/build-webpack     0.900.0-next.9
@angular-devkit/core              9.0.0-next.9
@angular-devkit/schematics        9.0.0-next.9
@angular/cli                      9.0.0-next.9
@ngtools/webpack                  9.0.0-next.9
@schematics/angular               9.0.0-next.9
@schematics/update                0.900.0-next.9
rxjs                              6.5.3
typescript                        3.5.3
webpack                           4.41.0

Anything else relevant?

Reverting to 9.0.0-next.8 removes the error.

@cexbrayat
Copy link
Member Author

I realize there is also an issue when running ng build --prod, but it’s maybe the same. In my repro, I have an image in src/assets. If the image is in src/assets/images, then running ng build --prod throws: Unable to copy assets: ENOTSUP: operation not supported on socket, copyfile '/Users/.../e2e-assets/src/assets/images' -> '/Users/.../e2e-assets/dist/e2e-assets/assets/images'.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.