You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading a project using assets feature to astro@3.0.0-beta.0, astro build fails with:
generating optimized images
error Could not find Sharp. Please install Sharp manually into your project.
File:
/workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/assets/generate.js:56:22
Code:
55 | const imageService = await getConfiguredImageService();
> 56 | const resultData = await imageService.transform(
| ^
57 | fileData,
58 | { ...options, src: originalImagePath },
59 | buildOpts.settings.config.image.service.config
Stacktrace:
Error: Could not find Sharp. Please install Sharp manually into your project.
at loadSharp (file:///workspaces/Website/dist/chunks/astro.7dbb7aca.mjs:3558:11)
at async Object.transform (file:///workspaces/Website/dist/chunks/astro.7dbb7aca.mjs:3569:15)
at async generateImage (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/assets/generate.js:56:22)
at async generateImage (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/generate.js:154:26)
at async generatePages (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/generate.js:141:7)
at async staticBuild (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/static-build.js:85:7)
at async AstroBuilder.build (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/index.js:128:5)
at async AstroBuilder.run (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/index.js:159:7)
at async build (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/core/build/index.js:37:3)
at async build (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/cli/build/index.js:20:3)
at async runCommand (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/cli/index.js:109:7)
at async cli (file:///workspaces/Website/node_modules/.pnpm/astro@3.0.0-beta.0_@types+node@20.4.6_sass@1.64.2_typescript@5.0.4/node_modules/astro/dist/cli/index.js:142:5)
astro dev works as expected. Adding sharp as a direct dependency resolves it for now, but I don't believe it should be necessary in 3.0.
What's the expected result?
Assets feature should work with Sharp (new default) without adding as a direct dependency.
At least that's how I understand #7908 and withastro/docs#3756 (comment)
What should I do?
For 99.999% of people, nothing! This change is invisible.
Link to Minimal Reproducible Example
N/A. Stackblitz is Node v16 only.
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
What version of
astro
are you using?3.0.0-beta.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Linux
What browser are you using?
Edge
Describe the Bug
After upgrading a project using assets feature to
astro@3.0.0-beta.0
,astro build
fails with:astro dev
works as expected. Addingsharp
as a direct dependency resolves it for now, but I don't believe it should be necessary in 3.0.What's the expected result?
Assets feature should work with Sharp (new default) without adding as a direct dependency.
At least that's how I understand #7908 and withastro/docs#3756 (comment)
Link to Minimal Reproducible Example
N/A. Stackblitz is Node v16 only.
Participation
The text was updated successfully, but these errors were encountered: