[GH-ISSUE #4756] [bug]: pnpm dev results in dev:vite exits with code 1 #1780

Open
opened 2026-03-16 21:42:59 +03:00 by kerem · 15 comments
Owner

Originally created by @yousefmarey12 on GitHub (Feb 15, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4756

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

so I am trying to spin up a dev server from my local machine in order to contribute to other GitHub issues for Hoppscotch. Docker uses a prebuilt image, so I can't modify source code and see my changes while using docker. I was recommended to use pnpm dev. The development server runs perfectly until I visit localhost:3000 and then dev:vite just crashes with code 1.

Image

Another hint is that when I open localhost:3000, there is a bunch of connection refused and empty response from the network tabs, which is quite strange. Perhaps anything to do with proxies or the WebSocket?

Image

Keep in mind I am using WSL Ubuntu and Node version 20.18.3

Would be happy to answer questions or concerns about the question or my system.

Thanks

Steps to reproduce

.

Environment

Production

Version

Self-hosted

Originally created by @yousefmarey12 on GitHub (Feb 15, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4756 ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current behavior so I am trying to spin up a dev server from my local machine in order to contribute to other GitHub issues for Hoppscotch. Docker uses a prebuilt image, so I can't modify source code and see my changes while using docker. I was recommended to use `pnpm dev`. The development server runs perfectly until I visit `localhost:3000` and then `dev:vite` just crashes with code 1. ![Image](https://github.com/user-attachments/assets/077fccc5-3c3e-4fba-ae8b-ffa1cff782ee) Another hint is that when I open `localhost:3000`, there is a bunch of connection refused and empty response from the network tabs, which is quite strange. Perhaps anything to do with proxies or the WebSocket? ![Image](https://github.com/user-attachments/assets/c9a1249c-5209-4cb3-b7fe-56aac11596c7) Keep in mind I am using WSL Ubuntu and Node version 20.18.3 Would be happy to answer questions or concerns about the question or my system. Thanks ### Steps to reproduce . ### Environment Production ### Version Self-hosted
Author
Owner

@xTudoS commented on GitHub (Feb 27, 2025):

Would you provide more log info about the vite?

<!-- gh-comment-id:2687929060 --> @xTudoS commented on GitHub (Feb 27, 2025): Would you provide more log info about the vite?
Author
Owner

@yousefmarey12 commented on GitHub (Mar 2, 2025):

Image

Image

Image

Image

Image

@xTudoS It could be a socket connection error? This is what the logs in the console have been telling.

<!-- gh-comment-id:2692528075 --> @yousefmarey12 commented on GitHub (Mar 2, 2025): ![Image](https://github.com/user-attachments/assets/14ebc686-3708-4381-b88b-36a265c9c3e4) ![Image](https://github.com/user-attachments/assets/ca3b6c7b-45c5-4935-ba71-50e28558ac4e) ![Image](https://github.com/user-attachments/assets/e3bca03f-4354-48e3-9c71-f8c3ca5a5f6f) ![Image](https://github.com/user-attachments/assets/bc84fa48-8c3f-4518-bd63-d10e25fe1449) ![Image](https://github.com/user-attachments/assets/258e6115-ab45-4731-b094-89e444468315) @xTudoS It could be a socket connection error? This is what the logs in the console have been telling.
Author
Owner

@xTudoS commented on GitHub (Mar 2, 2025):

Image

Image

Image

Image

Image

@xTudoS It could be a socket connection error? This is what the logs in the console have been telling.

Looks like you didn't setup the .env file

<!-- gh-comment-id:2692532186 --> @xTudoS commented on GitHub (Mar 2, 2025): > ![Image](https://github.com/user-attachments/assets/14ebc686-3708-4381-b88b-36a265c9c3e4) > > ![Image](https://github.com/user-attachments/assets/ca3b6c7b-45c5-4935-ba71-50e28558ac4e) > > ![Image](https://github.com/user-attachments/assets/e3bca03f-4354-48e3-9c71-f8c3ca5a5f6f) > > ![Image](https://github.com/user-attachments/assets/bc84fa48-8c3f-4518-bd63-d10e25fe1449) > > ![Image](https://github.com/user-attachments/assets/258e6115-ab45-4731-b094-89e444468315) > > [@xTudoS](https://github.com/xTudoS) It could be a socket connection error? This is what the logs in the console have been telling. Looks like you didn't setup the .env file
Author
Owner

@yousefmarey12 commented on GitHub (Mar 2, 2025):

@xTudoS
Oh, I actually did setup the .env file. What I exactly did was copy and paste the .env.example file into a new .env file. Then I installed the packages successfully with pnpm i and then I ran pnpm dev.

Here is my .env file:

#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch

# Auth Tokens Config
JWT_SECRET="secret1233"
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY= 3
# Default validity is 7 days (604800000 ms) in ms
REFRESH_TOKEN_VALIDITY="604800000"
# Default validity is 1 day (86400000 ms) in ms
ACCESS_TOKEN_VALIDITY="86400000"
SESSION_SECRET='add some secret here'
# Reccomended to be true, set to false if you are using http
# Note: Some auth providers may not support http requests
ALLOW_SECURE_COOKIES=true

# Sensitive Data Encryption Key while storing in Database (32 character)
DATA_ENCRYPTION_KEY="data encryption key with 32 char"

# Hoppscotch App Domain Config
REDIRECT_URL="http://localhost:3000"
WHITELISTED_ORIGINS="http://localhost:3170,http://localhost:3000,http://localhost:3100"
VITE_ALLOWED_AUTH_PROVIDERS=GOOGLE,GITHUB,MICROSOFT,EMAIL

# Google Auth Config
GOOGLE_CLIENT_ID="************************************************"
GOOGLE_CLIENT_SECRET="************************************************"
GOOGLE_CALLBACK_URL="http://localhost:3170/v1/auth/google/callback"
GOOGLE_SCOPE="email,profile"

# Github Auth Config
GITHUB_CLIENT_ID="************************************************"
GITHUB_CLIENT_SECRET="************************************************"
GITHUB_CALLBACK_URL="http://localhost:3170/v1/auth/github/callback"
GITHUB_SCOPE="user:email"

# Microsoft Auth Config
MICROSOFT_CLIENT_ID="************************************************"
MICROSOFT_CLIENT_SECRET="************************************************"
MICROSOFT_CALLBACK_URL="http://localhost:3170/v1/auth/microsoft/callback"
MICROSOFT_SCOPE="user.read"
MICROSOFT_TENANT="common"

# Mailer config
MAILER_SMTP_ENABLE="true"
MAILER_USE_CUSTOM_CONFIGS="false"
MAILER_ADDRESS_FROM='"From Name Here" <from@example.com>'

MAILER_SMTP_URL="smtps://user@domain.com:pass@smtp.domain.com" # used if custom mailer configs is false

# The following are used if custom mailer configs is true
MAILER_SMTP_HOST="smtp.domain.com"
MAILER_SMTP_PORT="587"
MAILER_SMTP_SECURE="true"
MAILER_SMTP_USER="user@domain.com"
MAILER_SMTP_PASSWORD="pass"
MAILER_TLS_REJECT_UNAUTHORIZED="true"

# Rate Limit Config
RATE_LIMIT_TTL=60 # In seconds
RATE_LIMIT_MAX=100 # Max requests per IP


#-----------------------Frontend Config------------------------------#


# Base URLs
VITE_BASE_URL=http://localhost:3000
VITE_SHORTCODE_BASE_URL=http://localhost:3000
VITE_ADMIN_URL=http://localhost:3100

# Backend URLs
VITE_BACKEND_GQL_URL=http://localhost:3170/graphql
VITE_BACKEND_WS_URL=ws://localhost:3170/graphql
VITE_BACKEND_API_URL=http://localhost:3170/v1

# Terms Of Service And Privacy Policy Links (Optional)
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy

# Set to `true` for subpath based access
ENABLE_SUBPATH_BASED_ACCESS=false

I just copied and pasted it, maybe there is some parsing error? Or do I need to change any of the configurations?

Thanks

<!-- gh-comment-id:2692826870 --> @yousefmarey12 commented on GitHub (Mar 2, 2025): @xTudoS Oh, I actually did setup the `.env` file. What I exactly did was copy and paste the `.env.example` file into a new `.env` file. Then I installed the packages successfully with `pnpm i` and then I ran `pnpm dev`. Here is my `.env` file: ```env #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch # Auth Tokens Config JWT_SECRET="secret1233" TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY= 3 # Default validity is 7 days (604800000 ms) in ms REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 1 day (86400000 ms) in ms ACCESS_TOKEN_VALIDITY="86400000" SESSION_SECRET='add some secret here' # Reccomended to be true, set to false if you are using http # Note: Some auth providers may not support http requests ALLOW_SECURE_COOKIES=true # Sensitive Data Encryption Key while storing in Database (32 character) DATA_ENCRYPTION_KEY="data encryption key with 32 char" # Hoppscotch App Domain Config REDIRECT_URL="http://localhost:3000" WHITELISTED_ORIGINS="http://localhost:3170,http://localhost:3000,http://localhost:3100" VITE_ALLOWED_AUTH_PROVIDERS=GOOGLE,GITHUB,MICROSOFT,EMAIL # Google Auth Config GOOGLE_CLIENT_ID="************************************************" GOOGLE_CLIENT_SECRET="************************************************" GOOGLE_CALLBACK_URL="http://localhost:3170/v1/auth/google/callback" GOOGLE_SCOPE="email,profile" # Github Auth Config GITHUB_CLIENT_ID="************************************************" GITHUB_CLIENT_SECRET="************************************************" GITHUB_CALLBACK_URL="http://localhost:3170/v1/auth/github/callback" GITHUB_SCOPE="user:email" # Microsoft Auth Config MICROSOFT_CLIENT_ID="************************************************" MICROSOFT_CLIENT_SECRET="************************************************" MICROSOFT_CALLBACK_URL="http://localhost:3170/v1/auth/microsoft/callback" MICROSOFT_SCOPE="user.read" MICROSOFT_TENANT="common" # Mailer config MAILER_SMTP_ENABLE="true" MAILER_USE_CUSTOM_CONFIGS="false" MAILER_ADDRESS_FROM='"From Name Here" <from@example.com>' MAILER_SMTP_URL="smtps://user@domain.com:pass@smtp.domain.com" # used if custom mailer configs is false # The following are used if custom mailer configs is true MAILER_SMTP_HOST="smtp.domain.com" MAILER_SMTP_PORT="587" MAILER_SMTP_SECURE="true" MAILER_SMTP_USER="user@domain.com" MAILER_SMTP_PASSWORD="pass" MAILER_TLS_REJECT_UNAUTHORIZED="true" # Rate Limit Config RATE_LIMIT_TTL=60 # In seconds RATE_LIMIT_MAX=100 # Max requests per IP #-----------------------Frontend Config------------------------------# # Base URLs VITE_BASE_URL=http://localhost:3000 VITE_SHORTCODE_BASE_URL=http://localhost:3000 VITE_ADMIN_URL=http://localhost:3100 # Backend URLs VITE_BACKEND_GQL_URL=http://localhost:3170/graphql VITE_BACKEND_WS_URL=ws://localhost:3170/graphql VITE_BACKEND_API_URL=http://localhost:3170/v1 # Terms Of Service And Privacy Policy Links (Optional) VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy # Set to `true` for subpath based access ENABLE_SUBPATH_BASED_ACCESS=false ``` I just copied and pasted it, maybe there is some parsing error? Or do I need to change any of the configurations? Thanks
Author
Owner

@xTudoS commented on GitHub (Mar 3, 2025):

@yousefmarey12 try updating the database url

=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch

this is probably the default to run using docker
if you are not, hoppscotch-db will not solve for any Ip address

you need to have Postgres installed and create an empty database for hoppscotch to use

and then update this line, where

postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch

postgres = Postgres user you setup in the installation
testpass = Postgres password you setup in the installation
hoppscotch-db = postgres hostname / ip -> if its running in the same machine probably will be localhost or 127.0.0.1
5432: Default port for postgres, no need to change

hoppscotch = the database you created for hoppscotch

<!-- gh-comment-id:2693019165 --> @xTudoS commented on GitHub (Mar 3, 2025): @yousefmarey12 try updating the database url =postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch this is probably the default to run using docker if you are not, hoppscotch-db will not solve for any Ip address you need to have Postgres installed and create an empty database for hoppscotch to use and then update this line, where postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch postgres = Postgres user you setup in the installation testpass = Postgres password you setup in the installation hoppscotch-db = postgres hostname / ip -> if its running in the same machine probably will be localhost or 127.0.0.1 5432: Default port for postgres, no need to change hoppscotch = the database you created for hoppscotch
Author
Owner

@yousefmarey12 commented on GitHub (Mar 3, 2025):

@xTudoS
Unfortunately still no luck.

What I did was follow these commands:

sudo service postgresql start

CREATE USER yousefmarey12 WITH PASSWORD 'PASSWORD';
CREATE DATABASE hoppscotch_db;
GRANT ALL PRIVILEGES ON DATABASE hoppscotch_db TO yousefmarey12;

and then I just put the appropriate values in the link. Is there supposed to be something running like a PostgreSQL service as there's nothing running when analyzing my ports. Am I missing any other commands?

Thanks

<!-- gh-comment-id:2695454278 --> @yousefmarey12 commented on GitHub (Mar 3, 2025): @xTudoS Unfortunately still no luck. What I did was follow these commands: `sudo service postgresql start` ``` CREATE USER yousefmarey12 WITH PASSWORD 'PASSWORD'; CREATE DATABASE hoppscotch_db; GRANT ALL PRIVILEGES ON DATABASE hoppscotch_db TO yousefmarey12; ``` and then I just put the appropriate values in the link. Is there supposed to be something running like a PostgreSQL service as there's nothing running when analyzing my ports. Am I missing any other commands? Thanks
Author
Owner

@xTudoS commented on GitHub (Mar 3, 2025):

@yousefmarey12 would you mind install pgadmin and try access your database?
pgadmin is an administrative interface for postgres

<!-- gh-comment-id:2695461568 --> @xTudoS commented on GitHub (Mar 3, 2025): @yousefmarey12 would you mind install pgadmin and try access your database? pgadmin is an administrative interface for postgres
Author
Owner

@yousefmarey12 commented on GitHub (Mar 3, 2025):

@xTudoS Will do now.

<!-- gh-comment-id:2695474860 --> @yousefmarey12 commented on GitHub (Mar 3, 2025): @xTudoS Will do now.
Author
Owner

@yousefmarey12 commented on GitHub (Mar 3, 2025):

@xTudoS
Hi,

Image

I accessed my database, but it still crashing. I believe the vite command is the one that's the problem. Maybe there is a connection?

<!-- gh-comment-id:2695535228 --> @yousefmarey12 commented on GitHub (Mar 3, 2025): @xTudoS Hi, ![Image](https://github.com/user-attachments/assets/9a64b43b-122a-457f-a652-9ffeb8d61c6f) I accessed my database, but it still crashing. I believe the `vite` command is the one that's the problem. Maybe there is a connection?
Author
Owner

@xTudoS commented on GitHub (Mar 4, 2025):

@yousefmarey12 try pnpm -r do-dev

<!-- gh-comment-id:2695987438 --> @xTudoS commented on GitHub (Mar 4, 2025): @yousefmarey12 try `pnpm -r do-dev`
Author
Owner

@yousefmarey12 commented on GitHub (Mar 4, 2025):

@xTudoS Still no luck.

I even tried it on different browsers, and the web socket is still not connecting. I do not want to play with any of the vite configurations as if it worked with other people, the problem is probably with my system. A hint is the following log:

Image

Could it be something wrong with my network and not Vite? Any suggestions?

<!-- gh-comment-id:2696776051 --> @yousefmarey12 commented on GitHub (Mar 4, 2025): @xTudoS Still no luck. I even tried it on different browsers, and the web socket is still not connecting. I do not want to play with any of the vite configurations as if it worked with other people, the problem is probably with my system. A hint is the following log: ![Image](https://github.com/user-attachments/assets/c6ac03ec-c6a1-439c-851d-dfe93c250543) Could it be something wrong with my network and not Vite? Any suggestions?
Author
Owner

@yousefmarey12 commented on GitHub (Mar 4, 2025):

@jamesgeorge007 , do you perhaps have an idea on what is going on? I would really appreciate your suggestion.

<!-- gh-comment-id:2696793712 --> @yousefmarey12 commented on GitHub (Mar 4, 2025): @jamesgeorge007 , do you perhaps have an idea on what is going on? I would really appreciate your suggestion.
Author
Owner

@xTudoS commented on GitHub (Mar 4, 2025):

@yousefmarey12 yeah
the problem is the server not starting,
would you mind sharing the full log of the vite?

you can try to run the docker version as well

install docker and in the terminal type docker compose up

<!-- gh-comment-id:2696794815 --> @xTudoS commented on GitHub (Mar 4, 2025): @yousefmarey12 yeah the problem is the server not starting, would you mind sharing the full log of the vite? you can try to run the docker version as well install docker and in the terminal type `docker compose up`
Author
Owner

@yousefmarey12 commented on GitHub (Mar 4, 2025):

@xTudoS

The problem with Docker is that I need the application to run from the source code and not a pre-built image. This is only for debugging purposes so I can solve other issues in this repository.

Regarding Vite's full log, is it just a flag on pnpm dev? If you know the specific flag for seeing the logs for vite, that would be great. (I tried pnpm --debug dev)

<!-- gh-comment-id:2697589872 --> @yousefmarey12 commented on GitHub (Mar 4, 2025): @xTudoS The problem with Docker is that I need the application to run from the source code and not a pre-built image. This is only for debugging purposes so I can solve other issues in this repository. Regarding Vite's full log, is it just a flag on `pnpm dev`? If you know the specific flag for seeing the logs for vite, that would be great. (I tried `pnpm --debug dev`)
Author
Owner

@yousefmarey12 commented on GitHub (Mar 16, 2025):

@xTudoS

Hi,

If you contribute to this repo via code modification, how do you spin up a development server to test your changes?

Thanks

<!-- gh-comment-id:2727326470 --> @yousefmarey12 commented on GitHub (Mar 16, 2025): @xTudoS Hi, If you contribute to this repo via code modification, how do you spin up a development server to test your changes? Thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1780
No description provided.