-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Error: Cannot find module 'logo.png' #1271
Comments
Try ./logo.png |
Same results. Please see guidelines on I tries to import the image file from the import image from './logo.png';
assert.equal(image, '/assets/../logo.png?xxxx'); I can't figure out why it's failed on the CSS file. |
https://github.com/webpack-contrib/css-loader#url /* src/components/Header/Header.css */
.root {
background-image: url('./banner.png'); /* src/components/Header/banner.png */
} |
|
is this related with webpack's issue? |
Yes. Looks like it's the same issue. Disabling the |
I open a new project of "react-start-kit" and change the file Header.css to: .bannerTitle {
background: url('logo-small.png');
/*...*/
} And the build was failed with error: When I change it to: .bannerTitle {
background: url('./logo-small.png');
/*...*/
} Everything works fine. That's incompatible with the guidelines of |
For third-party libraries you may to disable CSS Modules, then |
Confirm. Working. Thanks! |
I have a component
Logo
withLogo.css
andlogo.png
files.When I use the image on the css file like:
I got the following error:
Error: Cannot find module 'logo.png'
If I change the path to
url('/logo.png')
and put the logo image on thepublic
folder, everything works fine but that's breaks the component-based UI development principle.The text was updated successfully, but these errors were encountered: