#Cannot use local image in markdown

1 messages · Page 1 of 1 (latest)

prime roost
#

How are you using the image in your template

turbid wadi
#

Everything works fine if the image is a link e.g. ogImage: https://example.com/image.jpg therefore using a local image doesn't work

neat rock
#

As astro Image component defaults to url/assets which is what ever asset you put in your public dir.

turbid wadi
neat rock
turbid wadi
#

That's a typo here, but the file name is correct then error

neat rock
#

Could you provide the content again?

neat rock
turbid wadi
neat rock
#

Just paste the error from your console or browser (if it says) here.

turbid wadi
#
17:43:02 [ERROR] [MissingImageDimension] Missing width and height attributes for /assets/images/default.jpg. When using remote images, both dimensions are required in order to avoid CLS.
  Hint:
    If your image is inside your `src` folder, you probably meant to import it instead. See the Imports guide for more information https://docs.astro.build/en/guides/imports/#other-assets. You can also use `inferSize={true}` for remote images to get the original dimensions.
  Error reference:
    https://docs.astro.build/en/reference/errors/missing-image-dimension/
17:45:30 [ERROR] Failed to parse URL from /assets/images/default.jpg
  Stack trace:
    at node:internal/deps/undici/undici:13178:13
    [...] See full stack trace in the browser, or rerun with --verbose.
  Caused by:
  Invalid URL
    at new URL (node:internal/url:816:29)
    at fetch (node:internal/deps/undici/undici:9998:25)
    at fetch (node:internal/bootstrap/web/exposed-window-or-worker:72:12)