Skip to content

Small Image issue #5583

Closed
Closed
@ostrichegret

Description

@ostrichegret

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions