mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #734] [Bug] Dockerfile.lite deps stage missing pnpm rebuild sharp causes ERR_MODULE_NOT_FOUND crash on startup #349
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gunterlie on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/734
Originally assigned to: @Romuromylus on GitHub.
Summary
Marinara Engine crashes on startup with
ERR_MODULE_NOT_FOUND: Cannot find package 'sharp'when using a self-built Dockerfile.lite image. Sharp is declared as an optional dependency
but is required at runtime — causing it to be dropped by
--no-optionalin the deps stageand leaving the production image without the sharp binary.
Expected behavior
Container starts successfully. Sharp native binary is available at runtime and sprite
generation + background removal work as expected.
Actual behavior
Container exits immediately on startup with:
Steps to reproduce
docker build --no-cache -f Dockerfile.lite -t marinara-engine:lite .Environment
Logs, screenshots, or video
Additional context
Root cause: The deps stage installs with
--no-optional --ignore-scripts:Sharp is declared as an optional dependency in
packages/server/package.json,so
--no-optionaldrops it entirely. Since sprite generation and backgroundremoval depend on sharp at runtime, this declaration is incorrect.
Workaround that confirmed working (removes
--no-optionalfrom deps stage):Proper fix: Move sharp from
optionalDependenciestodependenciesinpackages/server/package.json. This keeps--no-optionalworking correctlyto exclude onnxruntime and other heavy optional packages, while ensuring sharp
is always present at runtime.
Note: The previous changelog entry "Fixed Lite Docker sprite generation by rebuilding
the sharp native module" only addressed the builder stage. The deps stage was missed
because the root cause (sharp incorrectly marked as optional) was not identified.
Related: #572, #596
Template check
@Romuromylus commented on GitHub (May 12, 2026):
Checking