aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

How to set image paths correctly

Open vslzl opened this issue 6 years ago • 1 comments

I'm trying to set image src paths and css background image paths as follows:

<img src="images/1.png" />

or

.some-css-class{
    background-color:url('images/1.png');
}

but I'm getting error

NodeInvocationException: Prerendering failed because of error: Error: Cannot find module './images/1.png' at webpackMissingModule (webpack-internal:///./ClientApp/app/layout/layout.component.html:1:1035) at eval (webpack-internal:///./ClientApp/app/layout/layout.component.html:1:1124) at Object../ClientApp/app/layout/layout.component.html

my image file is at wwwroot/images/1.png

vslzl avatar May 11 '19 21:05 vslzl

Adding a slash before images will do the trick. So, the path should be as follows: <img src="/images/1.png" />

AsifulNobel avatar Jun 27 '19 18:06 AsifulNobel