From 0666e5311c4b107567391b561ca0df6ed74eaa13 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Fri, 3 May 2024 18:19:43 -0500 Subject: [PATCH] Declare jimp as external server package --- next.config.js | 3 +++ src/photo/form/PhotoForm.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index f0ff1b30..405f4137 100644 --- a/next.config.js +++ b/next.config.js @@ -35,6 +35,9 @@ const nextConfig = { .concat(createRemotePattern(HOSTNAME_AWS_S3)), minimumCacheTTL: 31536000, }, + experimental: { + serverComponentsExternalPackages: ['jimp'], + }, }; const withBundleAnalyzer = require('@next/bundle-analyzer')({ diff --git a/src/photo/form/PhotoForm.tsx b/src/photo/form/PhotoForm.tsx index 7e0e7f26..a354e49a 100644 --- a/src/photo/form/PhotoForm.tsx +++ b/src/photo/form/PhotoForm.tsx @@ -264,7 +264,7 @@ export default function PhotoForm({ url, 640, undefined, - window.location.origin, + typeof window !== 'undefined' ? window.location.origin : undefined, )} width={width} height={height}