Merge pull request #3516 from lohxt1/fix/server_rendered-logic

fix: server_rendered codemirror logic for newer versions of nextjs
This commit is contained in:
lohit 2024-11-20 19:05:20 +05:30 committed by GitHub
commit 6c2451b6f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
let CodeMirror; 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) { if (!SERVER_RENDERED) {
CodeMirror = require('codemirror'); CodeMirror = require('codemirror');

View File

@ -12,7 +12,7 @@ import brunoCommon from '@usebruno/common';
const { interpolate } = brunoCommon; const { interpolate } = brunoCommon;
let CodeMirror; 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'); const { get } = require('lodash');
if (!SERVER_RENDERED) { if (!SERVER_RENDERED) {

View File

@ -6,7 +6,7 @@
*/ */
let CodeMirror; 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) { if (!SERVER_RENDERED) {
CodeMirror = require('codemirror'); CodeMirror = require('codemirror');