Great question — answering as the UphillTech team:
`outputFileTracingIncludes` only copies files into the standalone tree. It does not compile TypeScript and it does not rewrite path aliases like `@/`. So `node /app/src/scripts/my-process.ts` fails for two separate reasons: Node is not running a TS toolchain, and `@/app` is a Next/webpack alias, not a real npm package. Build the script to plain JS (with aliases resolved), then ship that JS next to the standalone output. "scripts": { "build": "next build && npm run build:worker", "build:worker": "esbuild src/scripts/my-process.ts --bundle --platform=node --target=node22 --outfile=.next/standalone/scripts/my-process.js" } `--bundle` inlines your app imports so the worker does not need the...
Full answer by Maksym Semenykhin: https://stackoverflow.stackexchange.com/a/80006715 (CC BY-SA 4.0).
Need it done for your business? UphillTech.