fix: resolve webpack build error for nodemailer in Docker

- next.config.ts: serverExternalPackages für nodemailer hinzugefügt
- instrumentation.ts: statischen Import durch dynamischen ersetzt, damit
  Webpack email-queue.ts (und damit nodemailer) nicht im Edge-Bundle analysiert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MBO-Tech-IT 2026-04-27 19:55:32 +02:00
parent 9e56f1b5a3
commit ad0c7adc27
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,6 @@
import { startEmailQueueWorker } from "@/lib/email-queue";
export async function register() { export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") { if (process.env.NEXT_RUNTIME === "nodejs") {
const { startEmailQueueWorker } = await import("@/lib/email-queue");
startEmailQueueWorker(); startEmailQueueWorker();
} }
} }

View File

@ -2,6 +2,7 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: "standalone", output: "standalone",
serverExternalPackages: ["nodemailer"],
}; };
export default nextConfig; export default nextConfig;