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

How to set image paths correctly #725

Open
vslzl opened this issue May 11, 2019 · 1 comment
Open

How to set image paths correctly #725

vslzl opened this issue May 11, 2019 · 1 comment

Comments

@vslzl
Copy link

vslzl commented May 11, 2019

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

@AsifulNobel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants