[GH-ISSUE #3435] [bug]: Self-Hosted AIO - POST http://localhost:3170/graphql net::ERR_CONNECTION_REFUSED #1160

Open
opened 2026-03-16 18:53:30 +03:00 by kerem · 18 comments
Owner

Originally created by @owlpro on GitHub (Oct 8, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3435

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

hi, after setup AIO with docker from hoppscotch/hoppscotch:2023.8.1
(https://hub.docker.com/layers/hoppscotch/hoppscotch/2023.8.1/images/sha256-8c4ea4157035f6ae5ac58d36d82e423287ec815f54c1350d00dde7f03236a112?context=explore)

i got this error
Screenshot from 2023-10-08 14-49-52

when i refresh from cache (Ctrl + Shift + R) there is no problem
but when i simple refresh (Ctrl + R) get this error

Cache Refresh import_meta_env variable values:
1111

Simple Refresh import_meta_env variable values:
Screenshot from 2023-10-08 14-54-43

Steps to reproduce

reproduce with docker:

version: '3.8'
services:
  postgres:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: psg_user
      POSTGRES_PASSWORD: psg_pass
    ports:
      - 5432:5432
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - hoppscotch-network

  adminer:
    image: adminer
    restart: always
    ports:
      - 9090:8080
    networks:
      - hoppscotch-network

  hoppscotch:
    image: hoppscotch/hoppscotch
    restart: always
    env_file: ./.env
    ports:
      - 3099:3000
      - 3100:3100
      - 3170:3170
    networks:
      - hoppscotch-network

volumes:
  pgdata:
    driver: local

networks:
  hoppscotch-network:
    driver: bridge

Environment

Production

Version

Self-hosted

Originally created by @owlpro on GitHub (Oct 8, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3435 ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current behavior hi, after setup AIO with docker from hoppscotch/hoppscotch:2023.8.1 (https://hub.docker.com/layers/hoppscotch/hoppscotch/2023.8.1/images/sha256-8c4ea4157035f6ae5ac58d36d82e423287ec815f54c1350d00dde7f03236a112?context=explore) i got this error ![Screenshot from 2023-10-08 14-49-52](https://github.com/hoppscotch/hoppscotch/assets/44808170/3ebc8275-477d-4e0a-9fb0-67672ba61f3b) when i refresh from cache (Ctrl + Shift + R) there is no problem but when i simple refresh (Ctrl + R) get this error Cache Refresh `import_meta_env` variable values: ![1111](https://github.com/hoppscotch/hoppscotch/assets/44808170/478a615d-6564-4c57-874b-0270db85fb08) Simple Refresh `import_meta_env` variable values: ![Screenshot from 2023-10-08 14-54-43](https://github.com/hoppscotch/hoppscotch/assets/44808170/a7b8ab65-01a1-42b0-aeac-ef555bd7fa03) ### Steps to reproduce **reproduce with docker:** ``` version: '3.8' services: postgres: image: postgres restart: always environment: POSTGRES_USER: psg_user POSTGRES_PASSWORD: psg_pass ports: - 5432:5432 volumes: - pgdata:/var/lib/postgresql/data networks: - hoppscotch-network adminer: image: adminer restart: always ports: - 9090:8080 networks: - hoppscotch-network hoppscotch: image: hoppscotch/hoppscotch restart: always env_file: ./.env ports: - 3099:3000 - 3100:3100 - 3170:3170 networks: - hoppscotch-network volumes: pgdata: driver: local networks: hoppscotch-network: driver: bridge ``` ### Environment Production ### Version Self-hosted
Author
Owner

@owlpro commented on GitHub (Oct 9, 2023):

Is there a quick fix?
For example, a change in Docker or whatever

<!-- gh-comment-id:1752588707 --> @owlpro commented on GitHub (Oct 9, 2023): Is there a quick fix? For example, a change in Docker or whatever
Author
Owner

@icsy7867 commented on GitHub (Nov 7, 2023):

I am getting this as well. When I click the magic link, the console is showing attempts made to localhost:3170, instead of my set domain-name.com:3170

However the main site loads just fine.

<!-- gh-comment-id:1799303356 --> @icsy7867 commented on GitHub (Nov 7, 2023): I am getting this as well. When I click the magic link, the console is showing attempts made to localhost:3170, instead of my set domain-name.com:3170 However the main site loads just fine.
Author
Owner

@icsy7867 commented on GitHub (Nov 7, 2023):

I went ahead and converted to the three separate containers:
hoppscotch-frontend
hoppscotch-backend
hoppscotch-admin

And I am getting the same errors. After successfully receiving the magic links and clicking them the console is showing all "localhost" URLS, instead of the URLS I have set in the .env file.

A hard cache reload fixes this, until I try to log in again, and then those variables are saved in my session.

<!-- gh-comment-id:1799383324 --> @icsy7867 commented on GitHub (Nov 7, 2023): I went ahead and converted to the three separate containers: hoppscotch-frontend hoppscotch-backend hoppscotch-admin And I am getting the same errors. After successfully receiving the magic links and clicking them the console is showing all "localhost" URLS, instead of the URLS I have set in the .env file. A hard cache reload fixes this, until I try to log in again, and then those variables are saved in my session.
Author
Owner

@jaydip-appvolution commented on GitHub (Jan 3, 2024):

I am using the AIO container of Hoppscotch and getting the same error while hosting on a domain.

Screenshot at Jan 03 17-40-28

Replace all localhost URLs to domain URLs but didn't get success.

Can someone help me to fix this?

<!-- gh-comment-id:1875279159 --> @jaydip-appvolution commented on GitHub (Jan 3, 2024): I am using the AIO container of Hoppscotch and getting the same error while hosting on a domain. ![Screenshot at Jan 03 17-40-28](https://github.com/hoppscotch/hoppscotch/assets/143718087/18252bed-121a-42fc-8859-06c3add9f46c) Replace all localhost URLs to domain URLs but didn't get success. Can someone help me to fix this?
Author
Owner

@owlpro commented on GitHub (Jan 4, 2024):

I am using the AIO container of Hoppscotch and getting the same error while hosting on a domain.

Screenshot at Jan 03 17-40-28

Replace all localhost URLs to domain URLs but didn't get success.

Can someone help me to fix this?

use this docker-compose.yml to fix:

version: '3.8'

services:
  postgres:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: secret
    ports:
      - 5432:5432
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - hoppscotch-network

  adminer:
    image: adminer
    restart: always
    ports:
      - 9090:8080
    networks:
      - hoppscotch-network
  
  hoppscotch-backend:
    image: hoppscotch/hoppscotch-backend
    restart: always
    env_file: ./prod.env
    ports:
      - 3170:3170
    networks:
      - hoppscotch-network

  hoppscotch-frontend:
    image: hoppscotch/hoppscotch-frontend
    restart: always
    env_file: ./prod.env
    ports:
      - 3099:8080
    networks:
      - hoppscotch-network

 
  hoppscotch-admin:
    image: hoppscotch/hoppscotch-admin
    restart: always
    env_file: ./prod.env
    ports:
      - 3100:8080
    networks:
      - hoppscotch-network

volumes:
  pgdata:
    driver: local

networks:
  hoppscotch-network:
    driver: bridge

<!-- gh-comment-id:1876906309 --> @owlpro commented on GitHub (Jan 4, 2024): > I am using the AIO container of Hoppscotch and getting the same error while hosting on a domain. > > ![Screenshot at Jan 03 17-40-28](https://private-user-images.githubusercontent.com/143718087/293909527-18252bed-121a-42fc-8859-06c3add9f46c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQzNjYyMDMsIm5iZiI6MTcwNDM2NTkwMywicGF0aCI6Ii8xNDM3MTgwODcvMjkzOTA5NTI3LTE4MjUyYmVkLTEyMWEtNDJmYy04ODU5LTA2YzNhZGQ5ZjQ2Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMTA0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDEwNFQxMDU4MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MjU3M2RmMTI3NWEzYzY5YWY3ZGUxZjA3ZDk4MDY5NTA3YzllNGU3ZGRlMzdlMGJkOGIxZDQ0MTY0ZmQwYTdiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._YqlZagW050iH9GRdd2ElQH5qu0XgfvEFHSi8jtcvz8) > > Replace all localhost URLs to domain URLs but didn't get success. > > Can someone help me to fix this? use this docker-compose.yml to fix: ```yml version: '3.8' services: postgres: image: postgres restart: always environment: POSTGRES_USER: user POSTGRES_PASSWORD: secret ports: - 5432:5432 volumes: - pgdata:/var/lib/postgresql/data networks: - hoppscotch-network adminer: image: adminer restart: always ports: - 9090:8080 networks: - hoppscotch-network hoppscotch-backend: image: hoppscotch/hoppscotch-backend restart: always env_file: ./prod.env ports: - 3170:3170 networks: - hoppscotch-network hoppscotch-frontend: image: hoppscotch/hoppscotch-frontend restart: always env_file: ./prod.env ports: - 3099:8080 networks: - hoppscotch-network hoppscotch-admin: image: hoppscotch/hoppscotch-admin restart: always env_file: ./prod.env ports: - 3100:8080 networks: - hoppscotch-network volumes: pgdata: driver: local networks: hoppscotch-network: driver: bridge ```
Author
Owner

@danztohamaerp commented on GitHub (Sep 2, 2024):

so what's the fix? I'm having the same issue :(

<!-- gh-comment-id:2323736834 --> @danztohamaerp commented on GitHub (Sep 2, 2024): so what's the fix? I'm having the same issue :(
Author
Owner

@aryaag commented on GitHub (Sep 12, 2024):

@owlpro - Could you explain what the fix is?

<!-- gh-comment-id:2345311681 --> @aryaag commented on GitHub (Sep 12, 2024): @owlpro - Could you explain what the fix is?
Author
Owner

@owlpro commented on GitHub (Sep 12, 2024):

@owlpro - Could you explain what the fix is?

I don't know exactly
I was just looking for a way to use it
This problem is in the AIO container, and if it is Using individual containers for the services, this problem does not exist

docker-compose.yml

<!-- gh-comment-id:2345702841 --> @owlpro commented on GitHub (Sep 12, 2024): > @owlpro - Could you explain what the fix is? I don't know exactly I was just looking for a way to use it This problem is in the AIO container, and if it is [Using individual containers for the services](https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#using-individual-containers-for-the-services), this problem does not exist [docker-compose.yml](https://github.com/hoppscotch/hoppscotch/issues/3435#issuecomment-1876906309)
Author
Owner

@aryaag commented on GitHub (Sep 13, 2024):

In the end, what fixed it was moving away from AIO and path based routing. See more here.

<!-- gh-comment-id:2348812922 --> @aryaag commented on GitHub (Sep 13, 2024): In the end, what fixed it was moving away from AIO and path based routing. See more [here](https://github.com/hoppscotch/hoppscotch/issues/3237#issuecomment-2348810429).
Author
Owner

@bobafettfrom commented on GitHub (Nov 11, 2024):

Hi! Finally, can someone show a working config file (env) when I want to use my own domain name instead of localhost? for example when hoppscotch is behind nginx or another reverse proxy

<!-- gh-comment-id:2469024084 --> @bobafettfrom commented on GitHub (Nov 11, 2024): Hi! Finally, can someone show a working config file (env) when I want to use my own domain name instead of localhost? for example when hoppscotch is behind nginx or another reverse proxy
Author
Owner

@samaphp commented on GitHub (Nov 24, 2024):

This project is incredibly promising. I'm not sure why the docker compose file has decided to go for the "twice is nice" approach with duplicated services. it’s a bit confusing and frustrating to debug just for a hands on demo.

I'm still trying to solve this puzzle, It seems you should use the happy scenario in order to make it work and avoid change the localhost or the external ports.

Thank you to all the contributors for the hard work in building such a useful dev tool!

<!-- gh-comment-id:2496040472 --> @samaphp commented on GitHub (Nov 24, 2024): This project is incredibly promising. I'm not sure why the docker compose file has decided to go for the "twice is nice" approach with duplicated services. it’s a bit confusing and frustrating to debug just for a hands on demo. I'm still trying to solve this puzzle, It seems you should use the happy scenario in order to make it work and avoid change the localhost or the external ports. Thank you to all the contributors for the hard work in building such a useful dev tool!
Author
Owner

@conquista41 commented on GitHub (Jan 3, 2025):

any updates about using own domain behind a reverse proxy? @bobafettfrom

<!-- gh-comment-id:2569941291 --> @conquista41 commented on GitHub (Jan 3, 2025): any updates about using own domain behind a reverse proxy? @bobafettfrom
Author
Owner

@brecht-vermeersch commented on GitHub (Mar 20, 2025):

Works for me with this env

ENABLE_SUBPATH_BASED_ACCESS=true

VITE_ALLOWED_AUTH_PROVIDERS=MICROSOFT
VITE_BASE_URL=http://localhost:8080
VITE_SHORTCODE_BASE_URL=http://localhost:8080
VITE_ADMIN_URL=http://localhost:8080
VITE_BACKEND_GQL_URL=http://localhost:8080/backend/graphql
VITE_BACKEND_WS_URL=wss://localhost:8080/backend/graphql
VITE_BACKEND_API_URL=http://localhost:8080/backend/v1

/graphql becomes /backend/graphql

<!-- gh-comment-id:2739639228 --> @brecht-vermeersch commented on GitHub (Mar 20, 2025): Works for me with this env ``` ENABLE_SUBPATH_BASED_ACCESS=true VITE_ALLOWED_AUTH_PROVIDERS=MICROSOFT VITE_BASE_URL=http://localhost:8080 VITE_SHORTCODE_BASE_URL=http://localhost:8080 VITE_ADMIN_URL=http://localhost:8080 VITE_BACKEND_GQL_URL=http://localhost:8080/backend/graphql VITE_BACKEND_WS_URL=wss://localhost:8080/backend/graphql VITE_BACKEND_API_URL=http://localhost:8080/backend/v1 ``` /graphql becomes /backend/graphql
Author
Owner

@MadWalnut commented on GitHub (Apr 16, 2025):

I also have to hard reload (Ctrl+F5) almost every time I open Hoppscotch. Without doing that all my environments and workspaces are gone. This seems to be an issue with the AIO-container, ENABLE_SUBPATH_BASED_ACCESS=true and a reverse proxy with a domain (in my case Caddy with TLS for https://hoppscotch.domain.com).

@CuriousCorrelation sorry for the direct ping, but would you mind taking a look at this? Can we provide any more information to help? Thank you very much!

For reference, this is my setup:

services:
  hoppscotch-postgres:
    image: postgres:17
    container_name: hoppscotch-postgres
    restart: unless-stopped
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
    networks:
      - reverse_proxy
      - hoppscotch
    environment:
      - POSTGRES_DB=hoppscotch
      - POSTGRES_USER=hoppscotch
      - POSTGRES_PASSWORD=password

  hoppscotch-app:
    image: hoppscotch/hoppscotch:latest
    container_name: hoppscotch-app
    restart: unless-stopped
    depends_on:
      - hoppscotch-postgres
    networks:
      - reverse_proxy
      - hoppscotch
    env_file:
      - .env
    ports:
      - 5000:5000

networks:
  reverse_proxy:
    external: true
  hoppscotch:
#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://hoppscotch:password@hoppscotch-postgres:5432/hoppscotch

# (Optional) By default, the AIO container (when in subpath access mode) exposes the endpoint on port 80. Use this setting to specify a different port if needed.
HOPP_AIO_ALTERNATE_PORT=5000 # Cannot use 80 because reverse proxy uses 80 and 443

# Auth Tokens Config
JWT_SECRET=secretcode123
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=anothersecretcode123

# Recommended 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=********************************

# Hoppscotch App Domain Config
REDIRECT_URL=https://hoppscotch.domain.com
# Whitelisted origins for the Hoppscotch App.
WHITELISTED_ORIGINS=http://localhost:3170,http://localhost:3000,http://localhost:3100,app://localhost_3200,app://hoppscotch,https://hoppscotch.domain.com
VITE_ALLOWED_AUTH_PROVIDERS=EMAIL

# Mailer config
MAILER_SMTP_ENABLE=true
MAILER_USE_CUSTOM_CONFIGS=true
MAILER_ADDRESS_FROM=Hoppscotch <hoppscotch@domain.com>

# The following are used if custom mailer configs is true
MAILER_SMTP_HOST=smtp.domain.com
MAILER_SMTP_PORT=25
MAILER_SMTP_SECURE=false
MAILER_SMTP_USER=DUMMY
MAILER_SMTP_PASSWORD=DUMMY
MAILER_TLS_REJECT_UNAUTHORIZED=false

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

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

# Base URLs
VITE_BASE_URL=https://hoppscotch.domain.com
VITE_SHORTCODE_BASE_URL=https://hoppscotch.domain.com
VITE_ADMIN_URL=https://hoppscotch.domain.com/admin

# Backend URLs # sometimes get ignored, refresh with Ctrl+F5 to fix
VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/backend/graphql
VITE_BACKEND_API_URL=https://hoppscotch.domain.com/backend/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=true
<!-- gh-comment-id:2809255748 --> @MadWalnut commented on GitHub (Apr 16, 2025): I also have to hard reload (Ctrl+F5) almost every time I open Hoppscotch. Without doing that all my environments and workspaces are gone. This seems to be an issue with the AIO-container, `ENABLE_SUBPATH_BASED_ACCESS=true` and a reverse proxy with a domain (in my case Caddy with TLS for `https://hoppscotch.domain.com`). @CuriousCorrelation sorry for the direct ping, but would you mind taking a look at this? Can we provide any more information to help? Thank you very much! For reference, this is my setup: ``` services: hoppscotch-postgres: image: postgres:17 container_name: hoppscotch-postgres restart: unless-stopped volumes: - ./data/postgres:/var/lib/postgresql/data networks: - reverse_proxy - hoppscotch environment: - POSTGRES_DB=hoppscotch - POSTGRES_USER=hoppscotch - POSTGRES_PASSWORD=password hoppscotch-app: image: hoppscotch/hoppscotch:latest container_name: hoppscotch-app restart: unless-stopped depends_on: - hoppscotch-postgres networks: - reverse_proxy - hoppscotch env_file: - .env ports: - 5000:5000 networks: reverse_proxy: external: true hoppscotch: ``` ``` #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://hoppscotch:password@hoppscotch-postgres:5432/hoppscotch # (Optional) By default, the AIO container (when in subpath access mode) exposes the endpoint on port 80. Use this setting to specify a different port if needed. HOPP_AIO_ALTERNATE_PORT=5000 # Cannot use 80 because reverse proxy uses 80 and 443 # Auth Tokens Config JWT_SECRET=secretcode123 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=anothersecretcode123 # Recommended 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=******************************** # Hoppscotch App Domain Config REDIRECT_URL=https://hoppscotch.domain.com # Whitelisted origins for the Hoppscotch App. WHITELISTED_ORIGINS=http://localhost:3170,http://localhost:3000,http://localhost:3100,app://localhost_3200,app://hoppscotch,https://hoppscotch.domain.com VITE_ALLOWED_AUTH_PROVIDERS=EMAIL # Mailer config MAILER_SMTP_ENABLE=true MAILER_USE_CUSTOM_CONFIGS=true MAILER_ADDRESS_FROM=Hoppscotch <hoppscotch@domain.com> # The following are used if custom mailer configs is true MAILER_SMTP_HOST=smtp.domain.com MAILER_SMTP_PORT=25 MAILER_SMTP_SECURE=false MAILER_SMTP_USER=DUMMY MAILER_SMTP_PASSWORD=DUMMY MAILER_TLS_REJECT_UNAUTHORIZED=false # Rate Limit Config RATE_LIMIT_TTL=60 # In seconds RATE_LIMIT_MAX=100 # Max requests per IP #-----------------------Frontend Config------------------------------# # Base URLs VITE_BASE_URL=https://hoppscotch.domain.com VITE_SHORTCODE_BASE_URL=https://hoppscotch.domain.com VITE_ADMIN_URL=https://hoppscotch.domain.com/admin # Backend URLs # sometimes get ignored, refresh with Ctrl+F5 to fix VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/backend/graphql VITE_BACKEND_API_URL=https://hoppscotch.domain.com/backend/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=true ```
Author
Owner

@CuriousCorrelation commented on GitHub (Apr 16, 2025):

Hi @MadWalnut, thanks for the config details. While I don't have the full context at the moment, this appears similar to a known issue with service workers caching environment variables in some deployments. If that's the case, clearing the workbox cache might help:

In DevTools -> Application tab (Chrome/Edge/Brave) or Storage tab (Firefox) -> Cache Storage -> Your domain -> workbox-precache-v* -> Delete/Clear (option varies by browser)

After clearing, refresh the page and it should load with the correct environment variables.

<!-- gh-comment-id:2809771970 --> @CuriousCorrelation commented on GitHub (Apr 16, 2025): Hi @MadWalnut, thanks for the config details. While I don't have the full context at the moment, this appears similar to a known issue with service workers caching environment variables in some deployments. If that's the case, clearing the workbox cache might help: In DevTools -> `Application` tab (Chrome/Edge/Brave) or `Storage` tab (Firefox) -> `Cache Storage` -> Your domain -> `workbox-precache-v*` -> Delete/Clear (option varies by browser) After clearing, refresh the page and it should load with the correct environment variables.
Author
Owner

@MadWalnut commented on GitHub (Apr 17, 2025):

@CuriousCorrelation Thank you for your reply! That does indeed fix the issue. Ctrl+F5 works as well.

Can we help by providing more information to fix the underlying issue? Or perhaps test some potential fixes?

I would love to switch my company over to Hoppscotch from Postman, but explaining to my colleagues to Ctrl+F5 multiple times per day is a non starter :D

<!-- gh-comment-id:2812212060 --> @MadWalnut commented on GitHub (Apr 17, 2025): @CuriousCorrelation Thank you for your reply! That does indeed fix the issue. Ctrl+F5 works as well. Can we help by providing more information to fix the underlying issue? Or perhaps test some potential fixes? I would love to switch my company over to Hoppscotch from Postman, but explaining to my colleagues to Ctrl+F5 multiple times per day is a non starter :D
Author
Owner

@CuriousCorrelation commented on GitHub (Apr 17, 2025):

@MadWalnut Thanks for the confirmation.

If clearing workbox-precache-v* works, you shouldn't need to use Ctrl + F5 anymore. The app should load with the correct environment variables after that. This should be a one-time fix per browser, similar to opening the instance in a private session.

I imagine the reason for it is the cache (for offline support/PWA) built with prior environment variables not invalidating itself with new deployment variables. The reasons could be related to how environment variables are injected at runtime (vs build time).

Although that is just an educated guess at the moment because I’ve encountered similar issue when writing the new desktop app which is why the desktop differentiates between deployments via a hash, you can read more about that here https://github.com/hoppscotch/hoppscotch/issues/4891

We're tracking this caching behavior issue internally, in the meantime if using the Hoppsctoch Desktop app is a possibility in your environment, I think it might provide an immediate solution without any workarounds for your usecase. The desktop app has some advantages over the browser version due to its very nature, being closer to the platform, and could unblock your adoption initiative.

<!-- gh-comment-id:2812404691 --> @CuriousCorrelation commented on GitHub (Apr 17, 2025): @MadWalnut Thanks for the confirmation. If clearing `workbox-precache-v*` works, you shouldn't need to use `Ctrl + F5` anymore. The app should load with the correct environment variables after that. This should be a one-time fix per browser, similar to opening the instance in a private session. I imagine the reason for it is the cache (for offline support/PWA) built with prior environment variables not invalidating itself with new deployment variables. The reasons could be related to how environment variables are injected at runtime (vs build time). Although that is just an educated guess at the moment because I’ve encountered similar issue when writing the new desktop app which is why the desktop differentiates between deployments via a hash, you can read more about that here https://github.com/hoppscotch/hoppscotch/issues/4891 We're tracking this caching behavior issue internally, in the meantime if using the [Hoppsctoch Desktop](https://hoppscotch.com/download) app is a possibility in your environment, I think it might provide an immediate solution without any workarounds for your usecase. The desktop app has some advantages over the browser version due to its very nature, being closer to the platform, and could unblock your adoption initiative.
Author
Owner

@MadWalnut commented on GitHub (Apr 17, 2025):

@CuriousCorrelation Thank you for your detailed response. That is great news! I have indeed not encountered another problem since clearing workbox-precache-v* yesterday. Great to hear you continue to monitor this though. Keep up the great work with Hoppscotch!

<!-- gh-comment-id:2813809106 --> @MadWalnut commented on GitHub (Apr 17, 2025): @CuriousCorrelation Thank you for your detailed response. That is great news! I have indeed not encountered another problem since clearing `workbox-precache-v*` yesterday. Great to hear you continue to monitor this though. Keep up the great work with Hoppscotch!
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#1160
No description provided.