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

Sharp error #8489

Closed
1 task
kacperwyczawski opened this issue Sep 10, 2023 · 1 comment
Closed
1 task

Sharp error #8489

kacperwyczawski opened this issue Sep 10, 2023 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@kacperwyczawski
Copy link

kacperwyczawski commented Sep 10, 2023

Astro Info

Astro                    v3.0.12
Node                     v20.6.0
System                   Linux (x64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/prefetch

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I get Server Error: MissingSharp: Could not find Sharp. Please install Sharp ('sharp') manually into your project or migrate to another image service., despite having sharp installed.

Here is the output from bun pm ls:

$ bun pm ls
<projectPath> node_modules (834)
├── @astrojs/prefetch@0.4.0
├── @astrojs/tailwind@5.0.0
├── @fontsource-variable/fira-code@5.0.8
├── @fontsource-variable/inter@5.0.8
├── @fontsource-variable/sora@5.0.8
├── astro@3.0.12
├── sharp@0.32.5
└── tailwindcss@3.3.3

And here is the request that fails:

GET http://localhost:4321/_image?href=/@fs/<projectPath>/src/images/<imageName>.png?origWidth=1920&origHeight=1080&origFormat=png&f=webp

I am using <Image /> component from astro:assets.

What's the expected result?

Images should just work.

Link to Minimal Reproducible Example

I don't know if it's possible to create bun project in stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 10, 2023
@Princesseuh
Copy link
Member

Princesseuh commented Sep 10, 2023

This is a Bun issue unrelated to Astro. It seems like Sharp doesn't support Bun really well yet, or the reverse. Not sure. Either way, it's unrelated to us specifically (we use Sharp normally, case in point being that it works on npm, yarn and pnpm). I'd recommend checking the Bun and Sharp repos for issues related to this, there seems to be a few already.

In the meantime, you can use the Squoosh instead perhaps: https://docs.astro.build/en/guides/upgrade-to/v3/#what-should-i-do-22

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

No branches or pull requests

2 participants