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

@astrojs/image sharp integration: dyld: lazy symbol binding failed #6390

Closed
1 task
theurgi opened this issue Mar 1, 2023 · 2 comments
Closed
1 task

@astrojs/image sharp integration: dyld: lazy symbol binding failed #6390

theurgi opened this issue Mar 1, 2023 · 2 comments

Comments

@theurgi
Copy link

theurgi commented Mar 1, 2023

What version of astro are you using?

2.0.16

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

After installing @astrojs/image with the sharp integration, my project won't build. Without the sharp integration it builds fine.

I tried running pnpm rebuild sharp to no avail.

Below are steps for a manual reproduction. The stackblitz repro fails as well but with a different stack trace: Something went wrong installing the "sharp" module...

EDIT: I see now that StackBlitz doesn't support sharp:

The @astrojs/image default image transformer is based on Squoosh and uses WebAssembly libraries to support most deployment environments, including those that do not support sharp, such as StackBlitz

Steps taken

Installed with image and sharp

pnpm astro add image
pnpm install sharp

Configured astro.config.mjs

import image from '@astrojs/image'
import { defineConfig } from 'astro/config'

export default defineConfig({
  integrations: [
    image({
      serviceEntryPoint: '@astrojs/image/sharp',
    }),
  ],
})

Configured src/env.d.ts

/// <reference types="@astrojs/image/client" />

Stack trace on pnpm dev

❯ pnpm dev

> <package>@0.0.1 dev <project_root>
> astro dev

dyld: lazy symbol binding failed: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: <project_root>/node_modules/.pnpm/sharp@0.31.3/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: <project_root>/node_modules/.pnpm/sharp@0.31.3/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

 ELIFECYCLE  Command failed.
zsh: abort      pnpm dev

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-q3m5h1

Participation

  • I am willing to submit a pull request for this issue.
@theurgi
Copy link
Author

theurgi commented Mar 1, 2023

Turns out this looks like a sharp/macOS issue ( lovell/sharp#3438 ) that should be fixed in the next sharp release.

If anyone runs into this in the mean time, this is what fixed it for me: lovell/sharp#3438 (comment)

pnpm uninstall sharp
# then
pnpm install sharp@0.31.1

@Princesseuh
Copy link
Member

Thank you for investigating, this seems like it only affects a minority of users and will be fixed soon upstream, so I'll close this issue!

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