From d225dd33cffc03f9a927d5f666607c3e2f0f1492 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 15:02:09 +0300 Subject: [PATCH 1/2] Fixe Roboshield failing build --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c054e264..070a38176 100644 --- a/Dockerfile +++ b/Dockerfile @@ -405,7 +405,7 @@ RUN set -ex \ # PNPM # symlink some dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules -COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/next.config.js ./apps/roboshield/next.config.js +COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/next.config.mjs ./apps/roboshield/next.config.mjs COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/.env ./apps/roboshield/.env # Since we can't use output: "standalone", copy all app's dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/node_modules ./apps/roboshield/node_modules From a034fa7d06bb6c7f06ecfd2f46be9efc66b6f20d Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 15:50:53 +0300 Subject: [PATCH 2/2] Use nextconfig.js instead of mjs --- Dockerfile | 2 +- apps/roboshield/{next.config.mjs => next.config.js} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename apps/roboshield/{next.config.mjs => next.config.js} (94%) diff --git a/Dockerfile b/Dockerfile index 070a38176..7c054e264 100644 --- a/Dockerfile +++ b/Dockerfile @@ -405,7 +405,7 @@ RUN set -ex \ # PNPM # symlink some dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules -COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/next.config.mjs ./apps/roboshield/next.config.mjs +COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/next.config.js ./apps/roboshield/next.config.js COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/.env ./apps/roboshield/.env # Since we can't use output: "standalone", copy all app's dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/node_modules ./apps/roboshield/node_modules diff --git a/apps/roboshield/next.config.mjs b/apps/roboshield/next.config.js similarity index 94% rename from apps/roboshield/next.config.mjs rename to apps/roboshield/next.config.js index 1b520b07c..0abbfb651 100644 --- a/apps/roboshield/next.config.mjs +++ b/apps/roboshield/next.config.js @@ -1,5 +1,5 @@ -import { withSentryConfig } from "@sentry/nextjs"; -import path from "path"; +const { withSentryConfig } = require("@sentry/nextjs"); +const path = require("path"); const PROJECT_ROOT = process.env.PROJECT_ROOT?.trim(); const outputFileTracingRoot = PROJECT_ROOT @@ -41,7 +41,7 @@ const nextConfig = { }, }; -export default withSentryConfig(nextConfig, { +module.exports = withSentryConfig(nextConfig, { // For all available options, see: // https://github.com/getsentry/sentry-webpack-plugin#options