mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
🔧 fix: type checking for process.browser in api-endpoints.ts
This commit is contained in:
parent
229d6f2dfe
commit
2483623c88
1 changed files with 4 additions and 1 deletions
|
|
@ -3,7 +3,10 @@ import * as q from './types/queries';
|
||||||
import { ResourceType } from './accessPermissions';
|
import { ResourceType } from './accessPermissions';
|
||||||
|
|
||||||
let BASE_URL = '';
|
let BASE_URL = '';
|
||||||
if (typeof process === 'undefined' || process?.browser === true) {
|
if (
|
||||||
|
typeof process === 'undefined' ||
|
||||||
|
(process as typeof process & { browser?: boolean }).browser === true
|
||||||
|
) {
|
||||||
// process is only available in node context, or process.browser is true in client-side code
|
// process is only available in node context, or process.browser is true in client-side code
|
||||||
// This is to ensure that the BASE_URL is set correctly based on the <base>
|
// This is to ensure that the BASE_URL is set correctly based on the <base>
|
||||||
// element in the HTML document, if it exists.
|
// element in the HTML document, if it exists.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue