Files
autofirmer-expanded/next.config.ts
T
Brandon LiandClaude Fable 5 4edb771701 Fix TopstepX login loop on bundled builds: signalr's dynamic require
@microsoft/signalr does an unconditional require('ws')/require('eventsource')
when constructing a connection; bundled (turbopack) builds throw 'dynamic
usage of require is not supported', which the login chain mislabelled as a
login failure and retried every 60s. Externalize the package and never let
hub setup fail the login — REST polling covers everything the hub does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-13 13:28:09 -05:00

11 lines
405 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// @microsoft/signalr does dynamic require('ws')/require('eventsource') for
// its Node transports — bundling it (turbopack production builds) throws
// "dynamic usage of require is not supported" the moment a hub is built.
serverExternalPackages: ['better-sqlite3', '@microsoft/signalr'],
};
export default nextConfig;