0livare / astro-image-with-bun

A problem with Astro using the bun package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bun package manager does not work with Astro Image component

The bug causing this issue: lovell/sharp#3779

Temporary workaround for this issue: PlayForm/Compress#193 (comment)

This repo

This repo was created on 2023-09-19 by running npm create astro@latest with the following choices (though I don't think the choices matter all that much):

  • Include sample files
  • Install dependencies: Yes
  • Typescript: No
  • New Git repo: No

Run the code successfully with node:

git clone https://github.com/0livare/astro-image-with-bun.git
git checkout node-works
npm install
npm run build
# Build success

Then reproduce the problem with bun as a package manager

rm package-lock.json
rm -rf node_modules
bun install
bun run build
# Build fails: Could not find Sharp. Please install Sharp (`sharp`) manually

You can try to follow its directions:

bun add sharp
bun run build
# Build STILL fails: Could not find Sharp. Please install Sharp (`sharp`) manually

About

A problem with Astro using the bun package manager


Languages

Language:Astro 94.0%Language:JavaScript 6.0%