Last active
March 19, 2025 14:45
-
-
Save imWildCat/6a91d0080cfd0b5ac6b537ae82b26d69 to your computer and use it in GitHub Desktop.
nextjs 15 build error vs --no-mangling --no-lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#39 103.1 [1] Collecting page data ... | |
#39 104.0 [1] TypeError: Cannot read properties of undefined (reading 'match') | |
#39 104.0 [1] at C (.next/server/chunks/746.js:1:4246) | |
#39 104.0 [1] at E (.next/server/chunks/746.js:1:4344) | |
#39 104.0 [1] at F (.next/server/chunks/746.js:1:4796) | |
#39 104.0 [1] at new rv (.next/server/chunks/746.js:7:13698) | |
#39 104.0 [1] at 1133 (.next/server/app/api/inngest/route.js:1:7600) | |
#39 104.0 [1] at t (.next/server/webpack-runtime.js:1:511) | |
#39 104.0 [1] at 59912 (.next/server/app/api/inngest/route.js:77:10748) | |
#39 104.0 [1] at t (.next/server/webpack-runtime.js:1:511) | |
#39 104.0 [1] at <unknown> (.next/server/app/api/inngest/route.js:78:25657) | |
#39 104.0 [1] at t.a (.next/server/webpack-runtime.js:1:1292) | |
#39 104.0 [1] | |
#39 104.0 [1] > Build error occurred | |
#39 104.0 [1] [Error: Failed to collect page data for /api/inngest] { type: 'Error' } | |
#39 104.1 [1] ELIFECYCLE Command failed with exit code 1. | |
#39 104.1 [1] cd apps/backend && pnpm build exited with code 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// azure-email.ts | |
import { EmailClient } from "@azure/communication-email"; | |
import { env } from "~/env"; | |
// I spent ~24 hours before finding the problem is from this code below | |
export const azureEmailClient = new EmailClient(env.AZURE_COMMUNICATION_SERVICES_CONNECTION_STRING); | |
// in build env (docker), `AZURE_COMMUNICATION_SERVICES_CONNECTION_STRING` is not set. | |
// because the error message points to inngest not this code | |
// see error-build.log | |
// this works because it constructs the Email Client when this function is called | |
export function getAzureEmailClient() { | |
return new EmailClient(env.AZURE_COMMUNICATION_SERVICES_CONNECTION_STRING); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if using
npx next build --no-mangling --no-lint
the error stack looks right.