Skip to content

images that copied into the static folder(/_next/static/media/*) are damaged #274

Description

@Sharklegs

next verison: 11.1.2
next-optimized-images version: 2.6.2

images can be found in .next/static/media/ but can not preview or open, tips: it may damaged.
in server open the image in new tab, it is a white empty Square picture.
and the inlineImageLimit is 8192 by default right? but no matter how small the image is, and how big the file size I set , inline can not work, I always get copied to the static folder of next.

I change next to 10.1.3 then it perform well no such problem.

next.config.js:

const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');


module.exports = withPlugins(
  [optimizedImages],
  {
    reactStrictMode: true,
    webpack5: true,
  },
);

example:
there is an icon: assest/icon-tips.png

.main {
  background: url(../assets/icon-tips.png);
}

result:

.main {
  background: url(/_next/static/media/icon-tips.3d63b16b9e687dbf38305a2737e8895a.png);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions