diff --git a/examples/aws-nextjs/next.config.mjs b/examples/aws-nextjs/next.config.mjs index 4678774e6..f8b78b168 100644 --- a/examples/aws-nextjs/next.config.mjs +++ b/examples/aws-nextjs/next.config.mjs @@ -1,4 +1,14 @@ +import * as path from "node:path"; + /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + webpack: (config, { nextRuntime }) => { + if (nextRuntime === "edge") { + // Ensure sst uses Node's process module and not a popular shim package when compiling middleware. + config.resolve.alias.process = path.resolve("node:process"); + } + return config; + }, +}; export default nextConfig;