Components sourcemap not resolved when using sub-paths
Andriypodolian opened this issue · 1 comments
Which @angular/* package(s) are the source of the bug?
compiler, router
Is this a regression?
No
Description
Source mapping for style files does not work
I have attached a project in which I reproduced this problem.
If you go along the path of the localhost:4200/first-level
then the source map for styles is correct,
![Знімок екрана 2024-05-08 о 12 09 12](https://private-user-images.githubusercontent.com/50823653/328832133-9a0f7a68-d52f-4ae3-8da2-dfd3e75aa43e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5MjM1ODQsIm5iZiI6MTcxNTkyMzI4NCwicGF0aCI6Ii81MDgyMzY1My8zMjg4MzIxMzMtOWEwZjdhNjgtZDUyZi00YWUzLThkYTItZGZkM2U3NWFhNDNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDA1MjEyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRlN2M1MjhmYjk5MzhkOGZmMjI0NTJmYzM0NmZhZjM0NTJlYzdkMWY0NTkxZDZjNTQ3ODdlOGViODhkNGMyNWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SrEB4phrdjW2O7Qu6J0XSnfA_V9uDyo8w_3_H6gdwPo)
but if you go to the localhost:4200/first-level/second-level,
the path to the file is not defined
![Знімок екрана 2024-05-08 о 12 09 26](https://private-user-images.githubusercontent.com/50823653/328832557-f1e26c63-8d94-4073-83dc-655d0fd30b1f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5MjM1ODQsIm5iZiI6MTcxNTkyMzI4NCwicGF0aCI6Ii81MDgyMzY1My8zMjg4MzI1NTctZjFlMjZjNjMtOGQ5NC00MDczLTgzZGMtNjU1ZDBmZDMwYjFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDA1MjEyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3NWYzYThlODg4NjAwNjBhMTBmOTVkZGIyMzE5MDg1NDZiYjc3YzY2N2ZmMzg5ZThkODA3ZjhhOGNjM2M2ZmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xMo0SCqBtvAjO6sNbMMCYyQDd_DZ-zrVsM9sXmETwcQ)
Please provide a link to a minimal reproduction of the bug
https://github.com/Andriypodolian/scss-source-map
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 17.3.4
Node: 20.11.0
Package Manager: npm 10.2.4
OS: darwin arm64
Angular 17 with SSR, no standalone app
Anything else?
When you run with ssr "yarn start:prerender"
everything works correctly
Would be awesome if you allowed us to choose inline sourcemaps for component styles.
This would not only solve this issue but also work when using dev mode via custom domains & subdomains and also save a ton of extra OPTIONS & GET requests on each page load in dev mode.