Cannot load local images in CSS #2365
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
status: needs triage
This issue has not been triaged by maintainers
🐛 Bug Report
If you use the React/Webpack import css style where css files are imported into js files like
import styles from "./index.module.css";
then background images loaded by URL's fail for local images such as png's, svgs, and jpgs.Have you read the Contributing Guidelines on issues?
yes
To Reproduce
styles.module.css
file for theindex.js
landing page works nicely)background-image: url('<some-local-file>.png|jpg|svg')
type tag on an imported classExpected behavior
Docusaurus loads the png image and other common types (jpg, svg, etc) via the css
Actual Behavior
Docusaurus fails to load the background image with an error like so.
Your Environment
I've made no modifications to the webpack config that ships with
docusaurus-init
Reproducible Demo
I've modified
src/pages/index.js
andsrc/pages/styles.module.css
to load abackground-image
URL tag with a local png (static/img/docusaurus.png
). Run yarn start to see the error.https://github.com/Noah-Silvera/docusaurus-png-load-bug
The text was updated successfully, but these errors were encountered: