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

Unable to process images with the default configuration #4

Closed
bilalbox opened this issue Feb 10, 2024 · 2 comments
Closed

Unable to process images with the default configuration #4

bilalbox opened this issue Feb 10, 2024 · 2 comments

Comments

@bilalbox
Copy link

Describe the bug

When loading notes in my vault that include images, builds will succeed but the images will not display. The access logs in the server display the following errors for my attempts to access any of those images:

09:59:22 [500] /_image 92ms
Could not process image request: MissingSharp: Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.
    at loadSharp (/mnt/c/Users/bilal/Code/starlight-tutorial/node_modules/astro/dist/assets/services/sharp.js:19:11)
    at async Object.transform.....
.....

To Reproduce

Follow the getting started guide for Starlight followed by the getting started guide for starlight-obsidian. Upon adding the path to your obsidian vault into the astro.config.mjs, then running a npm run dev, the project will successfully build and be accessible on localhost. Attempt to visit some of your notes and you will find that images

Expected behavior

I was expecting everything to render just fine, or be fixed if "sharp" were installed (it is already installed by npm).

How often does this bug happen?

Every time

System Info

Ubuntu 22.04.3 on WSL (Windows 11)
Processor: AMD Ryzen 7 7735HS with Radeon Graphics, 3201 Mhz, 8 Core(s), 16 Logical Processor(s)
RAM: 32GB RAM
Storage: 512GB SSD

Additional Context

I tried I was able to resolve this by changing the image processing service to squoosh.

I'm not sure if this specific to my machine or a real problem with the project due to recent updates or the like, but just thought I'd share in hopes that it will help someone. This is a very beneficial package that you've put together and I'm happy have it working.

Thank you!

@HiDeoo
Copy link
Owner

HiDeoo commented Feb 10, 2024

Thanks for your feedback.

The issue does not seems to be related to this package or even Starlight as Sharp will only be used by Astro to optimize images. The fact that switching to Squoosh also points in that direction.

This is not something I can repro myself but I think trying a different Node/Sharp version would be my first attempt. Maybe the following pages could also provide some help:

If the issue persists, I would definitely recommend opening an issue in the Astro repository.

@HiDeoo HiDeoo closed this as completed Feb 10, 2024
@bilalbox
Copy link
Author

Thanks @HiDeoo ! Yes, after trying a few of the tips in that issue thread you linked to, I was able to get it working with the original sharp version 0.32.6. In the end, what seemed to work was upgrading to the latest node LTS (20.11.0) and nuking and redownloading sharp in the node_modules directory with an npm install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants