[GH-ISSUE #3405] [bug]: error at build #1143

Closed
opened 2026-03-16 18:50:31 +03:00 by kerem · 2 comments
Owner

Originally created by @vinicius-simfrete on GitHub (Sep 29, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3405

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I started building, I encountered an error in pnpm as shown below:
I have 64g of RAM for the application. Docker dont start and when i up the container;


[hoppscotch-sh-admin sh_admin_builder 2/2] RUN pnpm run build:
#0 1.659
#0 1.659 > hoppscotch-sh-admin@2023.8.0 build /usr/src/app/packages/hoppscotch-sh-admin
#0 1.659 > vite build
#0 1.659
#0 3.102 failed to load config from /usr/src/app/packages/hoppscotch-sh-admin/vite.config.ts
#0 3.103 error during build:
#0 3.103 ReferenceError: [import-meta-env] failed to load file content from "/usr/src/app/.env.example".
#0 3.103 at resolveEnvExampleKeys (/usr/src/app/node_modules/.pnpm/@import-meta-env+unplugin@0.4.8_@import-meta-env+cli@0.6.3_dotenv@16.3.1/node_modules/@import-meta-env/unplugin/dist/index.js:111:11)
#0 3.103 at /usr/src/app/node_modules/.pnpm/@import-meta-env+unplugin@0.4.8_@import-meta-env+cli@0.6.3_dotenv@16.3.1/node_modules/@import-meta-env/unplugin/dist/index.js:1445:26
#0 3.103 at Object. (/usr/src/app/node_modules/.pnpm/unplugin@1.2.0/node_modules/unplugin/dist/index.js:1239:32)
#0 3.103 at file:///usr/src/app/packages/hoppscotch-sh-admin/vite.config.ts.timestamp-1695934458893.mjs:93:56
#0 3.103 at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
#0 3.131  ELIFECYCLE  Command failed with exit code 1.


I tried to start Docker with the following configuration file:


version: "3.7"
services:

This service runs the backend app in the port 3170

hoppscotch-backend:
container_name: hoppscotch-backend
build:
dockerfile: prod.Dockerfile
context: .
target: backend
env_file:
- ./.env
restart: always
environment:
# Edit the below line to match your PostgresDB URL if you have an outside DB (make sure to update the .env file as well)
- DATABASE_URL=postgresql://************************************************************************?connect_timeout=300
- PORT=3170
volumes:
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
# - ./packages/hoppscotch-backend/:/usr/src/app
- /usr/src/app/node_modules/
ports:
- "3170:3170"


hoppscotch-app:
container_name: hoppscotch-app
build:
dockerfile: prod.Dockerfile
context: .
target: app
env_file:
- ./.env
depends_on:
- hoppscotch-backend
ports:
- "3000:8080"


hoppscotch-sh-admin:
container_name: hoppscotch-sh-admin
build:
dockerfile: prod.Dockerfile
context: .
target: sh_admin
env_file:
- ./.env
depends_on:
- hoppscotch-backend
ports:
- "3100:8080"

My file .env


#-----------------------Backend Config------------------------------#

Prisma Config

DATABASE_URL=****************************************************************************

Auth Tokens Config

JWT_SECRET=secretcode123
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=anothersecretcode123

Hoppscotch App Domain Config

REDIRECT_URL=http://localhost:3000
WHITELISTED_ORIGINS=http://localhost:3170,http://localhost:3000,http://localhost:3100
VITE_ALLOWED_AUTH_PROVIDERS=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_URL=********************************************************************************
MAILER_ADDRESS_FROM="*******************************"

Rate Limit Config

RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100

#-----------------------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=wss://localhost:3170/graphql
VITE_BACKEND_API_URL=http://localhost:3170/v1


Steps to reproduce

  1. install version 2023.8.0
  2. start the container if docker-compose file

Environment

Production

Version

Local

Originally created by @vinicius-simfrete on GitHub (Sep 29, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3405 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I started building, I encountered an error in pnpm as shown below: I have 64g of RAM for the application. Docker dont start and when i up the container; ------ > [hoppscotch-sh-admin sh_admin_builder 2/2] RUN pnpm run build: #0 1.659 #0 1.659 > hoppscotch-sh-admin@2023.8.0 build /usr/src/app/packages/hoppscotch-sh-admin #0 1.659 > vite build #0 1.659 #0 3.102 failed to load config from /usr/src/app/packages/hoppscotch-sh-admin/vite.config.ts #0 3.103 error during build: #0 3.103 ReferenceError: [import-meta-env] failed to load file content from "/usr/src/app/.env.example". #0 3.103 at resolveEnvExampleKeys (/usr/src/app/node_modules/.pnpm/@import-meta-env+unplugin@0.4.8_@import-meta-env+cli@0.6.3_dotenv@16.3.1/node_modules/@import-meta-env/unplugin/dist/index.js:111:11) #0 3.103 at /usr/src/app/node_modules/.pnpm/@import-meta-env+unplugin@0.4.8_@import-meta-env+cli@0.6.3_dotenv@16.3.1/node_modules/@import-meta-env/unplugin/dist/index.js:1445:26 #0 3.103 at Object.<anonymous> (/usr/src/app/node_modules/.pnpm/unplugin@1.2.0/node_modules/unplugin/dist/index.js:1239:32) #0 3.103 at file:///usr/src/app/packages/hoppscotch-sh-admin/vite.config.ts.timestamp-1695934458893.mjs:93:56 #0 3.103 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) #0 3.131  ELIFECYCLE  Command failed with exit code 1. ------ I tried to start Docker with the following configuration file: ------ version: "3.7" services: # This service runs the backend app in the port 3170 hoppscotch-backend: container_name: hoppscotch-backend build: dockerfile: prod.Dockerfile context: . target: backend env_file: - ./.env restart: always environment: # Edit the below line to match your PostgresDB URL if you have an outside DB (make sure to update the .env file as well) - DATABASE_URL=postgresql://************************************************************************?connect_timeout=300 - PORT=3170 volumes: # Uncomment the line below when modifying code. Only applicable when using the "dev" target. # - ./packages/hoppscotch-backend/:/usr/src/app - /usr/src/app/node_modules/ ports: - "3170:3170" -------- hoppscotch-app: container_name: hoppscotch-app build: dockerfile: prod.Dockerfile context: . target: app env_file: - ./.env depends_on: - hoppscotch-backend ports: - "3000:8080" -------- hoppscotch-sh-admin: container_name: hoppscotch-sh-admin build: dockerfile: prod.Dockerfile context: . target: sh_admin env_file: - ./.env depends_on: - hoppscotch-backend ports: - "3100:8080" ---------- My file .env ------------ #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=**************************************************************************** # Auth Tokens Config JWT_SECRET=secretcode123 TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY=3 REFRESH_TOKEN_VALIDITY=604800000 ACCESS_TOKEN_VALIDITY=86400000 SESSION_SECRET=anothersecretcode123 # Hoppscotch App Domain Config REDIRECT_URL=http://localhost:3000 WHITELISTED_ORIGINS=http://localhost:3170,http://localhost:3000,http://localhost:3100 VITE_ALLOWED_AUTH_PROVIDERS=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_URL=******************************************************************************** MAILER_ADDRESS_FROM="*******************************" # Rate Limit Config RATE_LIMIT_TTL=60 RATE_LIMIT_MAX=100 #-----------------------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=wss://localhost:3170/graphql VITE_BACKEND_API_URL=http://localhost:3170/v1 -------------- ### Steps to reproduce 1. install version 2023.8.0 2. start the container if docker-compose file 3. ### Environment Production ### Version Local
kerem 2026-03-16 18:50:31 +03:00
Author
Owner

@jordibeen commented on GitHub (Oct 2, 2023):

Duplicate of 3321 and 3378

<!-- gh-comment-id:1742626742 --> @jordibeen commented on GitHub (Oct 2, 2023): Duplicate of [3321](https://github.com/hoppscotch/hoppscotch/issues/3321) and [3378](https://github.com/hoppscotch/hoppscotch/issues/3378)
Author
Owner

@joeljstephen commented on GitHub (Apr 18, 2024):

@vinicius-simfrete Are you still facing this issue on the latest builds? If not, I will be closing this issue in a few days.

<!-- gh-comment-id:2063075151 --> @joeljstephen commented on GitHub (Apr 18, 2024): @vinicius-simfrete Are you still facing this issue on the latest builds? If not, I will be closing this issue in a few days.
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#1143
No description provided.