Static image rendering issue

While rendering a static image, below error is coming:

Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of “image/png”. Strict MIME type checking is enforced for module scripts per HTML spec.

code :

import noProd from “../asset/search-filter-trim.png”

<Image src={noProd} />

If you keep your files inside the src directory they will be imported correctly, please don’t use a root-level assets directory as we do not ship these to production

ok. Thanks @steve-t-shopify

@steve-t-shopify I’m currently facing the same issue trying to import images directly from src.

Example on src/test.tsx with the image also on src/image.png:

import testImage from "./image.png"
import { Image } from "@shopify/shop-minis-react"

export default function Test() {
  return <Image src={testImage} />
}