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
{{ message }}
Repository navigation
1.0.0-beta.16 broke the "assets" functionality #2396
Updated from 1.0.0-beta.15 to 1.0.0-beta.16.
Same exact "assets" directory and related config files setup worked fine before.
ERROR in ./src/app/login/login.component.html
Module not found: Error: Can't resolve './assets/logo.png' in 'C:\project1\src\app\login'
@ ./src/app/login/login.component.html 1:92-120
@ ./src/app/login/login.component.ts
@ ./src/app/login/index.ts
@ ./src/app/app.module.ts
@ ./src/app/index.ts
@ ./src/main.ts
@ multi main
Are there any new restrictions on what assets can be used and how they need to be configured?
The CHANGELOG doesn't seem to indicate anything that would be related to the assets.
Could fix(build): use config output path as default #2158 have potentially affected this flow?
OK, that sounds like a workaround for most cases, thank you @monojack .
Has anybody any idea how to overcome this issue if my app is not not served directly from the root of my domain (but from a subdirectory)?
By the way, this problem creeped into beta.15, too. Our project was building just fine but on a fresh checkout and npm install, since today it is broken ...
Reacted by Vitali Kniazeu, lschmitz, Meligy, Antony Budianto and Halil Karakose
Same here, working on beta 15, now either have to use / in path or make the relative path point up to src by using appropriate number of ../.
I.e in my src/app/shared/layout/header/header.html, I have to use../../../../assets/someimg.jpg
It looks like the use of the html-loader was added via the AOT support PR. (commit: d296778) html-loader attempts to find the assets at build time and assumes the assets are relative to the referencing HTML file.
The solution of @monojack doesn't work if you publish with a different <base></base> (with ng github-pages:deploy for example). This lead to broken assets
Reacted by Muhammed Hasan Celik and Vitali Kniazeu
Activity
thephred commentedon Sep 28, 2016
I made the comment in the gitter room. Please disregard, it was a red herring.
ellipizle commentedon Sep 29, 2016
same problem here too
monojack commentedon Sep 29, 2016
Was able to fix that by adding a
/în front ofassets. So,assets/logo.pngshould be/assets/logo.png.ellipizle commentedon Sep 29, 2016
yes. that solve the issue
jfmaeck commentedon Sep 29, 2016
OK, that sounds like a workaround for most cases, thank you @monojack .
Has anybody any idea how to overcome this issue if my app is not not served directly from the root of my domain (but from a subdirectory)?
By the way, this problem creeped into beta.15, too. Our project was building just fine but on a fresh checkout and npm install, since today it is broken ...
Bulan commentedon Sep 29, 2016
Same here, working on beta 15, now either have to use
/in path or make the relative path point up tosrcby using appropriate number of../.I.e in my
src/app/shared/layout/header/header.html, I have to use../../../../assets/someimg.jpgclydin commentedon Sep 29, 2016
It looks like the use of the
html-loaderwas added via the AOT support PR. (commit: d296778)html-loaderattempts to find the assets at build time and assumes the assets are relative to the referencing HTML file.@hansl
davinkevin commentedon Oct 1, 2016
The solution of @monojack doesn't work if you publish with a different
<base></base>(with ng github-pages:deploy for example). This lead to broken assetsMuhammedHasan commentedon Oct 5, 2016
As @davinkevin mention, it do not work with custom base tag.
[-]1.0.0-beta.16 update broke the assets functionality[/-][+]1.0.0-beta.16 broke the assets functionality[/+][-]1.0.0-beta.16 broke the assets functionality[/-][+]1.0.0-beta.16 broke the "assets" functionality[/+]filipesilva commentedon Oct 5, 2016
@TheLarkInn is there a way to use https://github.com/webpack/html-loader in which it works with relative paths AND with changed base-href?
Edit: some context webpack/html-loader#85
fix(build): remove html-loader
fix(build): remove html-loader (#2537)
filipesilva commentedon Oct 6, 2016
We've reverted the change that lead to this scenario in #2537.
fix(build): remove html-loader (angular#2537)
fix(build): remove html-loader (#2537)
fix(build): remove html-loader (angular#2537)
angular-automatic-lock-bot commentedon Sep 6, 2019
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.
fix(build): remove html-loader (angular#2537)