You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
I develop a white label app that should be used by multiple clients. As each client might have multiple environment I set each client assets in a common build configurations as it's persistent across environments and use multiple configuration for ng serve. For example
Serving clientA is used with ng serve configuration clientA,clientA-staging. For some reason seems like the assets from src/environments/clientA/assets/ are not included and I see that the browser get 404 error when trying to download an asset from there.
What makes me think it is a bug with ng serve is that when building the app using ng build configuration clientA,clientA-staging I see the assets from src/environments/clientA/assets/ are included in the build under the assets folder and that everything working as expected when serving the produced build in a docker.
Also note that when changing the order and running ng serve configuration clientA-staging,clientA everything working as expected.
When used ng serve configuration clientA,clientA-staging --verbose to try see some logs I see the log GET /assets/images/brand-logo-light.svg because the client does not accept HTML. ( brand-logo-light.svg is originated from src/environments/clientA/assets/) but I really cant tell if it's related.
Minimal Reproduction
Create similar build configuration hierarchy as described.
Try serving the app using ng serve with multiple configurations.
See if the assets are shown correctly.
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?
You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
When you run the command ng serve --configuration clientA,clientA-staging, the buildTarget configuration is overridden sequentially from left to right. As a result, the effective target becomes repro-assets-issue-app:build:clientA-staging.
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I develop a white label app that should be used by multiple clients. As each client might have multiple environment I set each client assets in a common build configurations as it's persistent across environments and use multiple configuration for ng serve. For example
Serving clientA is used with
ng serve configuration clientA,clientA-staging
. For some reason seems like the assets fromsrc/environments/clientA/assets/
are not included and I see that the browser get 404 error when trying to download an asset from there.What makes me think it is a bug with
ng serve
is that when building the app usingng build configuration clientA,clientA-staging
I see the assets fromsrc/environments/clientA/assets/
are included in the build under the assets folder and that everything working as expected when serving the produced build in a docker.Also note that when changing the order and running
ng serve configuration clientA-staging,clientA
everything working as expected.When used
ng serve configuration clientA,clientA-staging --verbose
to try see some logs I see the logGET /assets/images/brand-logo-light.svg because the client does not accept HTML.
(brand-logo-light.svg
is originated fromsrc/environments/clientA/assets/
) but I really cant tell if it's related.Minimal Reproduction
Create similar build configuration hierarchy as described.
Try serving the app using ng serve with multiple configurations.
See if the assets are shown correctly.
Simple Github repository that reproduce the issue can be found here:
https://github.com/OmerSec/repro-assets-issue-app
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: