Skip to content

Commit 8fee2d2

Browse files
fix(docker): force fresh install of optional native deps (lightningcss)
npm run build failed with "Cannot find module lightningcss.linux-x64- gnu.node". Tailwind v4 pulls lightningcss whose platform binary ships as an optionalDependency, and npm has a long-standing bug that skips those when a lockfile is present. Drop the lockfile in the deps stage and install with --include=optional so the Linux binary is fetched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 128978a commit 8fee2d2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
99
&& rm -rf /var/lib/apt/lists/*
1010
WORKDIR /app
1111
COPY package.json package-lock.json ./
12-
RUN npm install
12+
# Remove the lockfile so npm freshly resolves platform-specific optional
13+
# native binaries (lightningcss/Tailwind v4) for this Linux image — npm has a
14+
# long-standing bug that skips optional native deps when a lockfile is present.
15+
RUN rm -f package-lock.json && npm install --include=optional
1316

1417
# Build
1518
FROM base AS builder

0 commit comments

Comments
 (0)