From 24563bdaafcea97583801bb7c6579c524c8cff4e Mon Sep 17 00:00:00 2001 From: lohxt1 Date: Wed, 20 Nov 2024 19:03:36 +0530 Subject: [PATCH] fix: server_rendered codemirror logic for newer versions of nextjs --- packages/bruno-app/src/utils/codemirror/autocomplete.js | 2 +- packages/bruno-app/src/utils/codemirror/brunoVarInfo.js | 2 +- packages/bruno-app/src/utils/codemirror/javascript-lint.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bruno-app/src/utils/codemirror/autocomplete.js b/packages/bruno-app/src/utils/codemirror/autocomplete.js index f1e88537b..9c068f20e 100644 --- a/packages/bruno-app/src/utils/codemirror/autocomplete.js +++ b/packages/bruno-app/src/utils/codemirror/autocomplete.js @@ -1,5 +1,5 @@ let CodeMirror; -const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; +const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; if (!SERVER_RENDERED) { CodeMirror = require('codemirror'); diff --git a/packages/bruno-app/src/utils/codemirror/brunoVarInfo.js b/packages/bruno-app/src/utils/codemirror/brunoVarInfo.js index eb6a0cc7a..a3a86dc31 100644 --- a/packages/bruno-app/src/utils/codemirror/brunoVarInfo.js +++ b/packages/bruno-app/src/utils/codemirror/brunoVarInfo.js @@ -12,7 +12,7 @@ import brunoCommon from '@usebruno/common'; const { interpolate } = brunoCommon; let CodeMirror; -const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; +const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; const { get } = require('lodash'); if (!SERVER_RENDERED) { diff --git a/packages/bruno-app/src/utils/codemirror/javascript-lint.js b/packages/bruno-app/src/utils/codemirror/javascript-lint.js index a3a56857e..475686f5d 100644 --- a/packages/bruno-app/src/utils/codemirror/javascript-lint.js +++ b/packages/bruno-app/src/utils/codemirror/javascript-lint.js @@ -6,7 +6,7 @@ */ let CodeMirror; -const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; +const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; if (!SERVER_RENDERED) { CodeMirror = require('codemirror');