[GH-ISSUE #1090] [BUG]: Cannot destructure property 'MultiUserMode' of '(intermediate value)' as it is null #674

Closed
opened 2026-02-22 18:20:46 -05:00 by yindo · 12 comments
Owner

Originally created by @xiexikang on GitHub (Apr 12, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1090

How are you running AnythingLLM?

Local development

What happened?

http://x.x.x.x:3000/
I use another computer to access the address of my own computer

Are there known steps to reproduce?

image

Originally created by @xiexikang on GitHub (Apr 12, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1090 ### How are you running AnythingLLM? Local development ### What happened? http://x.x.x.x:3000/ I use another computer to access the address of my own computer ### Are there known steps to reproduce? ![image](https://github.com/Mintplex-Labs/anything-llm/assets/34528051/bfdef522-da15-4d2b-a18b-f0bbc6f77977)
yindo added the possible bug label 2026-02-22 18:20:46 -05:00
yindo closed this issue 2026-02-22 18:20:46 -05:00
Author
Owner

@timothycarambat commented on GitHub (Apr 12, 2024):

You need to change frontend/.env VITE_API_BASE='http://localhost:3001/api' to VITE_API_BASE='/api'

The env file says this as well https://github.com/Mintplex-Labs/anything-llm/blob/102689a77abb3271f6362855c4d90607c76f29b6/frontend/.env.example#L3

@timothycarambat commented on GitHub (Apr 12, 2024): You need to change frontend/.env `VITE_API_BASE='http://localhost:3001/api'` to `VITE_API_BASE='/api'` The env file says this as well https://github.com/Mintplex-Labs/anything-llm/blob/102689a77abb3271f6362855c4d90607c76f29b6/frontend/.env.example#L3
Author
Owner

@yongshengma commented on GitHub (Jun 5, 2024):

You need to change frontend/.env VITE_API_BASE='http://localhost:3001/api' to VITE_API_BASE='/api'

The env file says this as well

https://github.com/Mintplex-Labs/anything-llm/blob/102689a77abb3271f6362855c4d90607c76f29b6/frontend/.env.example#L3

I still have this issue after I uncommented as:
VITE_API_BASE='/api'

Tried different ways. ufw srtatus is inactive. Either dev or prod has exactly this issue. Any idea please?

@yongshengma commented on GitHub (Jun 5, 2024): > You need to change frontend/.env `VITE_API_BASE='http://localhost:3001/api'` to `VITE_API_BASE='/api'` > > The env file says this as well > > https://github.com/Mintplex-Labs/anything-llm/blob/102689a77abb3271f6362855c4d90607c76f29b6/frontend/.env.example#L3 I still have this issue after I uncommented as: `VITE_API_BASE='/api'` Tried different ways. ufw srtatus is inactive. Either dev or prod has exactly this issue. Any idea please?
Author
Owner

@yongshengma commented on GitHub (Jun 5, 2024):

@timothycarambat

BTW, both localhost and non-localhost access cannot work simutaneously, right? If .env is changed, is it necessary to run yarn setup again?

@yongshengma commented on GitHub (Jun 5, 2024): @timothycarambat BTW, both localhost and non-localhost access cannot work simutaneously, right? If .env is changed, is it necessary to run `yarn setup` again?
Author
Owner

@leozlee commented on GitHub (Sep 3, 2024):

Have u fixed this ?I have the same errors

@leozlee commented on GitHub (Sep 3, 2024): Have u fixed this ?I have the same errors
Author
Owner

@leozlee commented on GitHub (Sep 3, 2024):

I am not sure about this, cause I am new to web develop,but I can skip this error by doing this:
const validateSession = async () => {
const {
MultiUserMode,
RequiresAuth,
LLMProvider = null,
VectorDB = null,
} = await System.keys() || {};
to frontend/src/components/PrivateRoute/index.jsx

@leozlee commented on GitHub (Sep 3, 2024): I am not sure about this, cause I am new to web develop,but I can skip this error by doing this: const validateSession = async () => { const { MultiUserMode, RequiresAuth, LLMProvider = null, VectorDB = null, } = await System.keys() || {}; to frontend/src/components/PrivateRoute/index.jsx
Author
Owner

@timothycarambat commented on GitHub (Sep 3, 2024):

This bug exists because your backend is not running. Youll run into further issues even after navigating around it. It is a symptom of a larger issue and is related to how you set or or run the app

@timothycarambat commented on GitHub (Sep 3, 2024): This bug exists because your backend is not running. Youll run into further issues even after navigating around it. It is a symptom of a larger issue and is related to how you set or or run the app
Author
Owner

@leozlee commented on GitHub (Sep 4, 2024):

yes, I encountered other bugs, So what is the right way to deply the env to develop?I run this on my linux server and I open the browser from my windows, I guess there is a cors issus? It looks like frontend can`t connect to backend

@leozlee commented on GitHub (Sep 4, 2024): yes, I encountered other bugs, So what is the right way to deply the env to develop?I run this on my linux server and I open the browser from my windows, I guess there is a cors issus? It looks like frontend can`t connect to backend
Author
Owner

@timothycarambat commented on GitHub (Sep 4, 2024):

git clone <REPO URL>
cd anything-llm
yarn setup
developer ENVs all need to be set manually in the .env.development because we do not write to the .development end when not in production since it would undo your settings

then for me. I run each of these commands in 3 tabs
yarn dev:server
yarn dev:frontend
yarn dev:collector

@timothycarambat commented on GitHub (Sep 4, 2024): `git clone <REPO URL>` `cd anything-llm` `yarn setup` _developer ENVs all need to be set manually in the `.env.development` because we do not write to the `.development` end when not in production since it would undo your settings_ then for me. I run each of these commands in 3 tabs `yarn dev:server` `yarn dev:frontend` `yarn dev:collector`
Author
Owner

@leozlee commented on GitHub (Sep 5, 2024):

Yes, I have try those steps, Like :

SERVER_PORT=3001

and then:
.env in frontend :
VITE_API_BASE='/api'

but when I open 192.168.1.176:3000, it show
index.jsx:22 Uncaught (in promise) TypeError: Cannot destructure property 'MultiUserMode' of '(intermediate value)' as it is null.

@leozlee commented on GitHub (Sep 5, 2024): Yes, I have try those steps, Like : SERVER_PORT=3001 and then: .env in frontend : VITE_API_BASE='/api' but when I open 192.168.1.176:3000, it show index.jsx:22 Uncaught (in promise) TypeError: Cannot destructure property 'MultiUserMode' of '(intermediate value)' as it is null.
Author
Owner

@timothycarambat commented on GitHub (Sep 5, 2024):

@leozlee this makes sense, in development the frontend server is hotloaded and is served on localhost:3000 but the backend is hotloaded and served on localhost:3001. So if the API is just /api and you open 192.168.1.176:3000 it would try to reach your server on 192.168.1.176:3000/api - which does not exist.

The solution is in the frontend/.env.example!
https://github.com/Mintplex-Labs/anything-llm/blob/66ccce9fcc6819b44c7f8292dc79a890287ee29a/frontend/.env.example#L1

In your case, localhost needs to be that private IP

@timothycarambat commented on GitHub (Sep 5, 2024): @leozlee this makes sense, in development the frontend server is hotloaded and is served on `localhost:3000` but the backend is hotloaded and served on `localhost:3001`. So if the API is just `/api` and you open `192.168.1.176:3000` it would try to reach your server on `192.168.1.176:3000/api` - which does not exist. The solution is in the frontend/.env.example! https://github.com/Mintplex-Labs/anything-llm/blob/66ccce9fcc6819b44c7f8292dc79a890287ee29a/frontend/.env.example#L1 In your case, `localhost` needs to be that private IP
Author
Owner

@leozlee commented on GitHub (Sep 6, 2024):

Thanks for your patience.
I change the VITE_API_BASE='http://localhost:3001/api to VITE_API_BASE='http://192.168.1.176:3001/api but I get more errors:
Snipaste_2024-09-06_11-51-58

@leozlee commented on GitHub (Sep 6, 2024): Thanks for your patience. I change the `VITE_API_BASE='http://localhost:3001/api` to `VITE_API_BASE='http://192.168.1.176:3001/api` but I get more errors: ![Snipaste_2024-09-06_11-51-58](https://github.com/user-attachments/assets/935134ca-631e-4b53-91cd-b9beb67f2446)
Author
Owner

@timothycarambat commented on GitHub (Sep 6, 2024):

When you run yarn dev:server it should say which port the server will boot up on. Once it is live and running you should be able to go to browser and visit http://192.168.1.176:3001/api/ping and get an OK response.

Do you get that?

@timothycarambat commented on GitHub (Sep 6, 2024): When you run `yarn dev:server` it should say which port the server will boot up on. Once it is live and running you should be able to go to browser and visit `http://192.168.1.176:3001/api/ping` and get an `OK` response. Do you get that?
yindo changed title from [BUG]: Cannot destructure property 'MultiUserMode' of '(intermediate value)' as it is null to [GH-ISSUE #1090] [BUG]: Cannot destructure property 'MultiUserMode' of '(intermediate value)' as it is null 2026-06-05 14:36:36 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#674