Static assets that are used as a background in css emit a warning
See original GitHub issueBug report
- I’ve updated both my project and my packages to the latest Frontity versions: https://docs.frontity.org/guides/keep-frontity-updated
- I’ve searched for existing issues.
- I’ve checked the documentation: https://docs.frontity.org
- I’ve checked the community forum: https://community.frontity.org
Expected behavior Correctly styled rendering on the server side without any warnings when you add a static url from the server assets to the css props (like a background image)
Observed behavior If you import an image and you add it as a background-image via css or style props, the console shows a warning,
Screenshots
Steps involved to reproduce the problem
- Create a frontity repository: npx frontity create
- Add any image the theme package
- Import it on the component index
- Add it as a background of any html element
I have created a repository with a hyper-simplified version of frontity where there is only a div with a static image as background: https://github.com/husseincak/testing/
Info about the problem If you downgrade the package @frontity/core to the v 1.14.3, the warning no longer appears:
- @frontity/core: ^1.15.1 => 1.14.3 If i console.log the asset i get two different urls on the client and on the server:
- Background URL on client: /static/images/image.jpg
- Background URL on the server: __webpack_public_path__images/image.jpg
Maybe the problem is because the two urls are diferent so the component is being rendered as a different component on the server and on the client
Issue Analytics
- State:
- Created a year ago
- Comments:19 (8 by maintainers)
Top GitHub Comments
@luisherranz I don’t know, but we are updating to Webpack 5 after the WordCamp because we are running already into some conflicts with other packages. So, I’ll try after that.
Frontity v2 sounds good, but I have a lot on my plate right now 😆
Is there any update on this?