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

Small Image issue #5583

Closed
ostrichegret opened this issue Oct 26, 2018 · 1 comment
Closed

Small Image issue #5583

ostrichegret opened this issue Oct 26, 2018 · 1 comment

Comments

@ostrichegret
Copy link

Is this a bug report?

yes,

when i import small image, and use it:
import Logo from './logo.jpg'; <img src={Logo} alt="Logo"/>

on yarn start, it works well.
but on yarn build then yarn serve ( express js ),
the react point to non existance jpg file

<img src="/static/media/logo.e118d3b2.jpg" alt="Logo">

i have check and no file there, the jpg file is 8.00 KB (8,192 bytes).

Error with file loader? how to fix without ejecting create react app?
Thank you

Did you try recovering your dependencies?

yes, yarn 1.9.4

Which terms did you search for in User Guide?

image, jpg

Environment

npx create-react-app --info
Please specify the project directory:
create-react-app

For example:
create-react-app my-react-app

Run create-react-app --help to see all options.

Steps to Reproduce

(Write your steps here:)

Expected Behavior

I expect the yarn build should produce the small jpg file.

How to disable this :

To reduce the number of requests to the server, importing images that are less than 10,000 bytes returns a data URI instead of a path. This applies to the following file extensions: bmp, gif, jpg, jpeg, and png. SVG files are excluded due to #1153.

Actual Behavior

yarn serve using express
the react use non existence image file

react1

Reproducible Demo

@ostrichegret
Copy link
Author

fixed with this setting:
cereallarceny/cra-ssr#14

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant