Skip to content

fix: run prisma generate before tsc build in Dockerfile#2

Merged
N0tMaggi merged 1 commit into
mainfrom
fix/dockerfile-prisma-generate-order
May 5, 2026
Merged

fix: run prisma generate before tsc build in Dockerfile#2
N0tMaggi merged 1 commit into
mainfrom
fix/dockerfile-prisma-generate-order

Conversation

@N0tMaggi

@N0tMaggi N0tMaggi commented May 5, 2026

Copy link
Copy Markdown
Owner

Closes #1

Root cause

The Dockerfile ran prisma generate after npm run build. Since tsc needs the Prisma-generated types (PrismaClient, GuildConfig) to be present at compile time, all 5 errors were caused by a single ordering bug:

# before (broken)
RUN npm run build       ← types not yet generated
RUN npx prisma generate

# after (fixed)
RUN npx prisma generate ← types ready
RUN npm run build

Error cascade explained

With strict: true in tsconfig, missing GuildConfig caused config to resolve as any, which propagated into config?.retailers, making the .split(',').map(r => ...) callbacks implicitly any — triggering all three TS7006 errors downstream.

Fix

Swapped the two lines. No other changes.

Fixes #1 — tsc requires the Prisma-generated types (PrismaClient,
GuildConfig) to be present before compilation. Running prisma generate
after npm run build caused 5 TypeScript errors due to unresolved types
cascading into implicit-any errors in arrow functions.
@N0tMaggi N0tMaggi self-assigned this May 5, 2026
@N0tMaggi N0tMaggi added the enhancement New feature or request label May 5, 2026
@N0tMaggi

N0tMaggi commented May 5, 2026

Copy link
Copy Markdown
Owner Author

Builds and compiles successfully. :)

@N0tMaggi

N0tMaggi commented May 5, 2026

Copy link
Copy Markdown
Owner Author

Thank you for reporting :3

@N0tMaggi N0tMaggi merged commit fd60fc6 into main May 5, 2026
1 check passed
@N0tMaggi N0tMaggi deleted the fix/dockerfile-prisma-generate-order branch May 5, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerfile does not build - 5 errors

1 participant