From be0c42271f1f81947e5d166b1c390802cdee9c59 Mon Sep 17 00:00:00 2001 From: Ryan Elian Date: Fri, 7 Oct 2022 15:41:27 +0700 Subject: [PATCH] Update next config. Disable swcminify https://github.com/vercel/next.js/issues/40889 --- next.config.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/next.config.js b/next.config.js index 6e674ea..5a22cc2 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,4 @@ +// https://securityheaders.com/ function getSecurityHeaders(isProd) { const headers = [ { @@ -31,8 +32,9 @@ function getSecurityHeaders(isProd) { }, { // https://report-uri.com/home/generate + // https://csp-evaluator.withgoogle.com/ key: 'Content-Security-Policy', - value: `default-src 'self'; script-src 'self'; script-src-elem 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'` + value: `default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; object-src 'none'` } ); } @@ -54,7 +56,25 @@ module.exports = { oidcScope: process.env['OIDC_SCOPE'], }, productionBrowserSourceMaps: true, - swcMinify: true, + /* + Disable swcMinify for now + https://github.com/vercel/next.js/issues/40889 + + index.js:235 + + TypeError: number 0 is not iterable (cannot read property Symbol(Symbol.iterator)) + at new Map () + at Overflow.js:173:1 + at useBatchFrameState.js:32:34 + at eD (Overflow.js:173:1) + at P (Item.js:33:1) + at Item.js:38:1 + at uJ (react-dom.production.min.js:241:246) + at u1 (react-dom.production.min.js:245:114) + at o5 (react-dom.production.min.js:285:374) + at react-dom.production.min.js:284:398 + */ + swcMinify: false, async headers() { return [ {