fix(config): externalize ws for copilot-m365-web executor (#6098, closes #6062)

Externalize ws / bufferutil / utf-8-validate in serverExternalPackages so the copilot-m365-web WebSocket masking path works at runtime (bundling ws → TypeError: b.mask is not a function → 80s chat timeout). Regression guard in next-config.test.ts.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
This commit is contained in:
Ankit
2026-07-04 01:06:35 +05:30
committed by GitHub
parent 5bc11f4d0e
commit e61b75f007
510 changed files with 31655 additions and 6991 deletions

View File

@@ -94,6 +94,13 @@ function readTimeoutMs(...values) {
/** @type {import('next').NextConfig} */
const nextConfig = {
// Opt-in subpath deployment behind a reverse proxy (e.g. nginx/Caddy serving
// OmniRoute under https://host/omniroute/). Empty by default so root-path
// deployments are unaffected. Next.js strips this prefix from `pathname`
// before route matching, so authz classification (classifyRoute/isLocalOnlyPath)
// keeps operating on un-prefixed paths — see src/server/authz/pipeline.ts for
// the two redirect call sites that re-add it via `request.nextUrl.basePath`.
basePath: process.env.OMNIROUTE_BASE_PATH || "",
distDir,
// Turbopack config: redirect native modules to stubs at build time
turbopack: {
@@ -207,6 +214,13 @@ const nextConfig = {
"tough-cookie",
"@ngrok/ngrok",
"@huggingface/transformers",
// copilot-m365-web.ts imports 'ws' as a client-side WebSocket. When bundled,
// ws cannot resolve its 'bufferutil' native addon (frame masking) and throws
// TypeError: b.mask is not a function on the first outgoing frame, causing
// every chat request to time out at the stream-readiness watchdog. (#6062)
"ws",
"bufferutil",
"utf-8-validate",
"child_process",
"fs",
"path",