From 4e5b3d1f97c3254eab08f28860a05bb8c31fafb4 Mon Sep 17 00:00:00 2001 From: Kaan Yagci Date: Wed, 15 Jul 2026 22:35:23 +0200 Subject: [PATCH 1/2] fix dashboard esm-env runtime alias --- apps/start/Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/start/Dockerfile b/apps/start/Dockerfile index 71a3647bd..68ac01e42 100644 --- a/apps/start/Dockerfile +++ b/apps/start/Dockerfile @@ -120,6 +120,27 @@ COPY --from=build /app/apps/start/.output ./apps/start/.output COPY --from=build /app/apps/start/dist ./apps/start/dist COPY --from=build /app/apps/start/package.json ./apps/start/ +# The standalone Nitro output preserves the target package name for the pnpm +# esm-env -> esm-env-runtime override. @number-flow/react imports "esm-env" +# at runtime, so keep that package name resolvable inside the SSR bundle. +RUN set -eux; \ + node_modules="/app/apps/start/.output/server/node_modules"; \ + test -d "${node_modules}/esm-env-runtime"; \ + if [ ! -d "${node_modules}/esm-env" ]; then \ + mkdir -p "${node_modules}/esm-env"; \ + cp "${node_modules}/esm-env-runtime/node.js" "${node_modules}/esm-env/index.js"; \ + printf '%s\n' \ + '{' \ + ' "name": "esm-env",' \ + ' "version": "1.1.4",' \ + ' "type": "module",' \ + ' "exports": "./index.js"' \ + '}' \ + > "${node_modules}/esm-env/package.json"; \ + fi; \ + cd /app/apps/start/.output/server; \ + node --input-type=module -e 'import("esm-env").then((env) => { if (env.BROWSER !== false || env.NODE !== true) process.exit(1); })' + # Copy necessary packages COPY --from=build /app/packages/db ./packages/db COPY --from=build /app/packages/trpc ./packages/trpc From 3c92912438196f5875cf72d2c4ec31b205a6224e Mon Sep 17 00:00:00 2001 From: Kaan Yagci Date: Wed, 15 Jul 2026 22:48:58 +0200 Subject: [PATCH 2/2] address dashboard env assertion review --- apps/start/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/start/Dockerfile b/apps/start/Dockerfile index 68ac01e42..9c013da41 100644 --- a/apps/start/Dockerfile +++ b/apps/start/Dockerfile @@ -139,7 +139,7 @@ RUN set -eux; \ > "${node_modules}/esm-env/package.json"; \ fi; \ cd /app/apps/start/.output/server; \ - node --input-type=module -e 'import("esm-env").then((env) => { if (env.BROWSER !== false || env.NODE !== true) process.exit(1); })' + node --input-type=module -e 'const assert = await import("node:assert/strict"); const env = await import("esm-env"); assert.equal(env.BROWSER, false, "esm-env BROWSER should be false in the Node SSR runtime"); assert.equal(env.NODE, true, "esm-env NODE should be true in the Node SSR runtime"); assert.equal(env.DEV, false, "esm-env DEV should be false in the production runtime");' # Copy necessary packages COPY --from=build /app/packages/db ./packages/db