#4394

Docker image 26.10.1 crash-loops on start: Cannot find module 'sharp'

Openmahfuz-rahman007opened 2d ago

Version: ghcr.io/heyputer/puter:26.10.1 (previous release, 26.10, starts fine)

What happens: the container crash-loops right after start with:

Error: Cannot find module 'sharp'

The require is thrown from ReplicateImageGenerationProvider (src/backend/drivers/ai-image/providers/replicate/ReplicateImageGenerationProvider.ts, which has a top-level import sharp from 'sharp'), so the backend never finishes booting.

Repro:

docker run --rm -p 4100:4100 ghcr.io/heyputer/puter:26.10.1

No custom config mounted.

Observations from the 26.10.1 sources (not confirmed as the cause):

  • 26.10.1 moves the Dockerfile to node:26-bookworm-slim (#4295).
  • sharp is declared in src/backend/package.json (^0.35.5), not in the root package.json.
  • In package-lock.json the 0.35.5 copy is nested at src/backend/node_modules/sharp, while the hoisted node_modules/sharp is 0.35.4 and flagged dev.
  • The compiled backend runs from dist/src/backend/..., so it resolves modules from /opt/puter/node_modules, not from /opt/puter/src/backend/node_modules.

It may be worth checking whether sharp actually ends up resolvable from dist/ in the final image stage (e.g. docker run --rm --entrypoint node ghcr.io/heyputer/puter:26.10.1 -e "require('sharp')"), and if not, whether declaring it where it gets hoisted or loading it lazily in the Replicate provider fixes it.

Happy to test a fix against the image.

Activity

0

No activity yet.