2c1299bd51
Production image bootlooped with:
Cannot find module './internal/class.ts'
at /app/dist/generated/prisma/client.js:40:29
The Prisma 7 `prisma-client` generator (provider="prisma-client" in
schema.prisma) emits TypeScript source whose internal imports use
explicit `.ts` extensions (import x from "./internal/class.ts").
With module=nodenext, tsc preserves those extensions in the emitted
JS unless rewriteRelativeImportExtensions is on, so the compiled
client did `require("./internal/class.ts")` at runtime → ENOENT.
Set rewriteRelativeImportExtensions: true in tsconfig.json (added in
TS 5.7, we're on 5.7.3). tsc now rewrites .ts → .js in the emitted
require calls, matching the .js files actually present.
Also add a .dockerignore. The local smoke test was passing because
the COPY . . step was overlaying a pre-existing generated/prisma/
(left over from a previous prisma-client-js install with .js output)
on top of the fresh .ts output from `npm ci`'s postinstall. CI's
clean checkout had no override, so the bug was visible there first.
Excluding generated/, node_modules/, and dist/ from the build
context forces every build (local and CI) to use the fresh
regenerated output — same code path everywhere.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
719 B
JSON
27 lines
719 B
JSON
{
|
|
"compilerOptions": {
|
|
"module": "nodenext",
|
|
"moduleResolution": "nodenext",
|
|
"resolvePackageJsonExports": true,
|
|
"rewriteRelativeImportExtensions": true,
|
|
"esModuleInterop": true,
|
|
"isolatedModules": true,
|
|
"declaration": true,
|
|
"removeComments": true,
|
|
"emitDecoratorMetadata": true,
|
|
"experimentalDecorators": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"target": "ES2023",
|
|
"sourceMap": true,
|
|
"outDir": "./dist",
|
|
"baseUrl": "./",
|
|
"incremental": true,
|
|
"skipLibCheck": true,
|
|
"strictNullChecks": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"noImplicitAny": true,
|
|
"strictBindCallApply": true,
|
|
"noFallthroughCasesInSwitch": true
|
|
}
|
|
}
|