sim icon indicating copy to clipboard operation
sim copied to clipboard

[BUG] Seeing a blank page for local development

Open NuDheeraj opened this issue 3 months ago • 7 comments

Describe the bug The app fails to load on main branch

To Reproduce Steps to reproduce the behavior:

  1. Follow the Self-hosted: Manual Setup
  2. Create a new user in the login page
  3. automatically get redirected to link
  4. See error in frontend console logs

Expected behavior Able to open the workspace properly

Screenshots

Briefly I see this:

Image

then browser gets blank and stuck:

Image

Additional context

Added frontend and backend logs

is there a stable tag or branch to follow?

frontend_logs.log

backend_logs.log

NuDheeraj avatar Oct 25 '25 02:10 NuDheeraj

I switched to tag v0.4.23 same issue cc: @waleedlatif1 @icecrasher321, seeing the same recursive button error The above error occurred in the <button> component. It was handled by the <ErrorBoundary> error boundary., also I see basic requirements like zustand missing in package.json, is there some other branch I should use?

NuDheeraj avatar Oct 25 '25 02:10 NuDheeraj

Wauuu

sub, 25. lis 2025. 04:13 NuDheeraj @.***> je napisao:

NuDheeraj left a comment (simstudioai/sim#1726) https://github.com/simstudioai/sim/issues/1726#issuecomment-3445486710

I switched to tag v0.4.23 same issue cc: @waleedlatif1 https://github.com/waleedlatif1 @icecrasher321 https://github.com/icecrasher321, seeing the same recursive button error The above error occurred in the

— Reply to this email directly, view it on GitHub https://github.com/simstudioai/sim/issues/1726#issuecomment-3445486710, or unsubscribe https://github.com/notifications/unsubscribe-auth/BU4CU7JOQFJTLBNI6GAWURT3ZLMDNAVCNFSM6AAAAACKFLSTCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINBVGQ4DMNZRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

elviromercic23-cmyk avatar Oct 26 '25 22:10 elviromercic23-cmyk

@emir-karabeg @waleedlatif1 any pointers on how to resolve this?

NuDheeraj avatar Oct 27 '25 17:10 NuDheeraj

I also have the same issue with @NuDheeraj , I did some debug logs in backend frontend:

Image Image

backend:

Image

Hung392001 avatar Oct 28 '25 14:10 Hung392001

@NuDheeraj its hard to tell, but the blank screen is usually the result of the browser going out of sync with the database. If you've logged into the platform on the same URL and have a different DB connected to it now than when you logged in, the session cookie in your browser is for a different DB and this may be causing issues. To absolve this, you need to open DevTools in the browser > application > cookies > delete the corresponding cookies from the old DB's session. Then you can try logging in again from scratch and see if this fixes the blank screen

waleedlatif1 avatar Oct 28 '25 16:10 waleedlatif1

@waleedlatif1 I have tried everything by now :), I have tried clearing cache, cleared application site data, installed on a new system from scratch, logged in as new user, tried a new machine, docker exec'd into the db to see if the user has permissions for the workspace and workflow.

Also I notices some weird bugs like when we first start the server, it complains and exits about many missing packages, like Zustand, loadash, etc. Also I am seeing some 404 errors when we are trying to open a canvas for the newly created users(as the graph is empty and backend throws error). I guess there are some seeding scripts or pre installation scripts that are not opensourced, hence you might not be seeing it.

Because of the above I think at this point the dev flow for external contributors is completely broken, it would be great help if you can fix the dev flow for us or suggest me what changes are needed.

NuDheeraj avatar Oct 29 '25 00:10 NuDheeraj

I was having similar issues, here's how I got local dev working. I'm using dockered postgres and ollama. Follow the instructions normally with these deviations. You'll still have to install ollama, bun, docker, etc.

You need to edit both .env files

Image

The .env.example file in sim/apps/sim/app/ should actually be in sim/apps/sim. It seems to be in the WRONG directory.

cd sim
cp apps/sim/app/.env.example apps/sim/.env

and should look something like this

# Database (Required)
DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"

# PostgreSQL Port (Optional) - defaults to 5432 if not specified
# POSTGRES_PORT=5432

# Authentication (Required)
BETTER_AUTH_SECRET=your_secret_key  # Use `openssl rand -hex 32` to generate, or visit https://www.better-auth.com/docs/installation
BETTER_AUTH_URL=http://localhost:3000

# NextJS (Required)
NEXT_PUBLIC_SOCKET_URL="http://192.168.4.105:3002"
NEXT_PUBLIC_APP_URL=http://"http://192.168.4.105:3000

# Security (Required)
ENCRYPTION_KEY=your_encryption_key  # Use `openssl rand -hex 32` to generate, used to encrypt environment variables
INTERNAL_API_SECRET=your_internal_api_secret # Use `openssl rand -hex 32` to generate, used to encrypt internal api routes

# Email Provider (Optional)
# RESEND_API_KEY=  # Uncomment and add your key from https://resend.com to send actual emails
                   # If left commented out, emails will be logged to console instead

# Local AI Models (Optional)
OLLAMA_URL=http://localhost:11434  # URL for local Ollama server - uncomment if using local models

If you have a dev server using it's ip address seems necessary or you get some CORs weirdness.

you should also edit apps/sim/next.config.ts and add your ip address to "allowedDevOrigins"

Image

And then the other steps are more or less the same. This is by no means a production setup but should get you going for local dev. Replace 192.168.4.105 with you boxes LOCAL ip (don't point this thing to the internet).

I was able to make an account, log in, and build a simple chatbot.

small-goblin avatar Nov 24 '25 05:11 small-goblin