From 25eff48973646ac4babd54e6e4c20c79d1784575 Mon Sep 17 00:00:00 2001 From: Nick Cernis Date: Thu, 22 Dec 2022 14:00:05 +0100 Subject: [PATCH] fix: prevent Local 502 error by using unoptimized images Local 6.6+ uses Electron 21, which implements a new memory cage feature: https://www.electronjs.org/blog/v8-memory-cage The memory cage prevents Node.js modules such as sharp from working: https://github.com/lovell/sharp/issues/3384 Sharp is used by Next.js to optimize images. The result is that Local produces a 502 when users create new sites using this blueprint, due to the optimized logo image in the header and in featured images. Using the `unoptimized` prop prevents this. The fix could be removed when Electron updates with the patched version of Node.js that allows sharp's workaround to function, and when Local has updated to that Electron version. --- components/FeaturedImage/FeaturedImage.js | 1 + components/Header/Header.js | 1 + 2 files changed, 2 insertions(+) diff --git a/components/FeaturedImage/FeaturedImage.js b/components/FeaturedImage/FeaturedImage.js index c45784f..3e1985b 100644 --- a/components/FeaturedImage/FeaturedImage.js +++ b/components/FeaturedImage/FeaturedImage.js @@ -38,6 +38,7 @@ export default function FeaturedImage({ alt={altText} objectFit="cover" layout="responsive" + unoptimized={true} {...props} /> diff --git a/components/Header/Header.js b/components/Header/Header.js index e7adfc9..f28f8f9 100644 --- a/components/Header/Header.js +++ b/components/Header/Header.js @@ -37,6 +37,7 @@ export default function Header({ className, menuItems }) { height={80} alt="Blueprint media logo" layout="responsive" + unoptimized={true} />