[GH-ISSUE #5052] [bug]: hoppscotch-selfhost-web fails to build in recent main #1925

Open
opened 2026-03-16 22:23:27 +03:00 by kerem · 3 comments
Owner

Originally created by @html1101 on GitHub (May 5, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5052

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Current behavior

When building hoppscotch-selfhost-web locally from scratch, hoppscotch-selfhost-web fails to build because it relies on built information in hoppscotch-data which hasn't been built yet and causes an error.

Steps to reproduce

  1. Clone Hoppscotch on main branch
  2. Fill .env files with configuration
  3. Run just the backend using Docker: docker-compose --profile just-backend
  4. Install with pnpm: pnpm install
  5. Then attempt to build and run the selfhosted web app: pnpm run generate && pnpm start

Then in step 5 is where I'm seeing the error. I was able to get it working only after building in hoppscotch-data first by cd-ing in and running pnpm run build, so it seems like an ordering issue where hoppscotch-data needs to be built before hoppscotch-selfhost-web, but I'm unsure.

Logs and Screenshots

sarah@sudo-mini:~/hoppscotch$ pnpm run generate
...
packages/hoppscotch-selfhost-web do-build-prod: ✓ 6257 modules transformed.
packages/hoppscotch-selfhost-web do-build-prod: x Build failed in 10.27s
packages/hoppscotch-selfhost-web do-build-prod: error during build:
packages/hoppscotch-selfhost-web do-build-prod: [vite-plugin-pwa:build] ../hoppscotch-common/src/helpers/utils/EffectiveURL.ts (38:9): "calculateHawkHeader" is not exported by "../hoppscotch-data/dist/hoppscotch-data.js", imported by "../hoppscotch-common/src/helpers/utils/EffectiveURL.ts".
packages/hoppscotch-selfhost-web do-build-prod: file: /home/sarah/hoppscotch/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts:38:9
packages/hoppscotch-selfhost-web do-build-prod: 36:   generateDigestAuthHeader,
packages/hoppscotch-selfhost-web do-build-prod: 37: } from "../auth/digest"
packages/hoppscotch-selfhost-web do-build-prod: 38: import { calculateHawkHeader } from "@hoppscotch/data"
packages/hoppscotch-selfhost-web do-build-prod:              ^
packages/hoppscotch-selfhost-web do-build-prod: 39: 
packages/hoppscotch-selfhost-web do-build-prod: 40: export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
packages/hoppscotch-selfhost-web do-build-prod:     at getRollupError (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:395:41)
packages/hoppscotch-selfhost-web do-build-prod:     at error (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:391:42)
packages/hoppscotch-selfhost-web do-build-prod:     at Module.error (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15535:16)
packages/hoppscotch-selfhost-web do-build-prod:     at Module.traceVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15984:29)
packages/hoppscotch-selfhost-web do-build-prod:     at ModuleScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:13770:39)
packages/hoppscotch-selfhost-web do-build-prod:     at ReturnValueScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
packages/hoppscotch-selfhost-web do-build-prod:     at FunctionBodyScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
packages/hoppscotch-selfhost-web do-build-prod:     at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
packages/hoppscotch-selfhost-web do-build-prod:     at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
packages/hoppscotch-selfhost-web do-build-prod:     at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
packages/hoppscotch-selfhost-web do-build-prod:  ELIFECYCLE  Command failed with exit code 1.
packages/hoppscotch-selfhost-web do-build-prod: Failed

Environment

Production

Hoppscotch Version

Local

Interceptor

Not Applicable - Issue not related to network requests

Browsers Affected

No response

Operating System

Linux

Additional Information

No response

Originally created by @html1101 on GitHub (May 5, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5052 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Current behavior When building `hoppscotch-selfhost-web` locally from scratch, `hoppscotch-selfhost-web` fails to build because it relies on built information in `hoppscotch-data` which hasn't been built yet and causes an error. ### Steps to reproduce 1. Clone Hoppscotch on main branch 2. Fill .env files with configuration 3. Run just the backend using Docker: `docker-compose --profile just-backend` 4. Install with pnpm: `pnpm install` 5. Then attempt to build and run the selfhosted web app: `pnpm run generate && pnpm start` Then in step 5 is where I'm seeing the error. I was able to get it working only after building in `hoppscotch-data` first by `cd`-ing in and running `pnpm run build`, so it seems like an ordering issue where `hoppscotch-data` needs to be built before `hoppscotch-selfhost-web`, but I'm unsure. ### Logs and Screenshots ```shell sarah@sudo-mini:~/hoppscotch$ pnpm run generate ... packages/hoppscotch-selfhost-web do-build-prod: ✓ 6257 modules transformed. packages/hoppscotch-selfhost-web do-build-prod: x Build failed in 10.27s packages/hoppscotch-selfhost-web do-build-prod: error during build: packages/hoppscotch-selfhost-web do-build-prod: [vite-plugin-pwa:build] ../hoppscotch-common/src/helpers/utils/EffectiveURL.ts (38:9): "calculateHawkHeader" is not exported by "../hoppscotch-data/dist/hoppscotch-data.js", imported by "../hoppscotch-common/src/helpers/utils/EffectiveURL.ts". packages/hoppscotch-selfhost-web do-build-prod: file: /home/sarah/hoppscotch/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts:38:9 packages/hoppscotch-selfhost-web do-build-prod: 36: generateDigestAuthHeader, packages/hoppscotch-selfhost-web do-build-prod: 37: } from "../auth/digest" packages/hoppscotch-selfhost-web do-build-prod: 38: import { calculateHawkHeader } from "@hoppscotch/data" packages/hoppscotch-selfhost-web do-build-prod: ^ packages/hoppscotch-selfhost-web do-build-prod: 39: packages/hoppscotch-selfhost-web do-build-prod: 40: export interface EffectiveHoppRESTRequest extends HoppRESTRequest { packages/hoppscotch-selfhost-web do-build-prod: at getRollupError (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:395:41) packages/hoppscotch-selfhost-web do-build-prod: at error (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:391:42) packages/hoppscotch-selfhost-web do-build-prod: at Module.error (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15535:16) packages/hoppscotch-selfhost-web do-build-prod: at Module.traceVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15984:29) packages/hoppscotch-selfhost-web do-build-prod: at ModuleScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:13770:39) packages/hoppscotch-selfhost-web do-build-prod: at ReturnValueScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) packages/hoppscotch-selfhost-web do-build-prod: at FunctionBodyScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) packages/hoppscotch-selfhost-web do-build-prod: at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) packages/hoppscotch-selfhost-web do-build-prod: at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) packages/hoppscotch-selfhost-web do-build-prod: at TrackingScope.findVariable (file:///home/sarah/hoppscotch/node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) packages/hoppscotch-selfhost-web do-build-prod:  ELIFECYCLE  Command failed with exit code 1. packages/hoppscotch-selfhost-web do-build-prod: Failed ``` ### Environment Production ### Hoppscotch Version Local ### Interceptor Not Applicable - Issue not related to network requests ### Browsers Affected _No response_ ### Operating System Linux ### Additional Information _No response_
Author
Owner

@g3Bg2 commented on GitHub (May 7, 2025):

@html1101, which pnpm version are you using?

Also there is no pnpm start in hoppscotch-selfhost-web

<!-- gh-comment-id:2858658586 --> @g3Bg2 commented on GitHub (May 7, 2025): @html1101, which **pnpm** version are you using? Also there is no **pnpm start** in **hoppscotch-selfhost-web**
Author
Owner

@html1101 commented on GitHub (May 8, 2025):

I was using version 10.2.1, and pnpm start was run from the main directory, not from the hoppscotch-selfhost-web but I believe that runs the http-server of the web instantiation, right, since it runs the command http-server packages/hoppscotch-selfhost-web/dist -p 3000?

<!-- gh-comment-id:2863637987 --> @html1101 commented on GitHub (May 8, 2025): I was using version `10.2.1`, and `pnpm start` was run from the main directory, not from the `hoppscotch-selfhost-web` but I believe that runs the `http-server` of the web instantiation, right, since it runs the command `http-server packages/hoppscotch-selfhost-web/dist -p 3000`?
Author
Owner

@g3Bg2 commented on GitHub (May 8, 2025):

Yes.

Working perfectly fine on my end.

When you do pnpm install from the main dir, it should generate the build files in hoppscotch-data.
Also, check if it is exporting calculateHawkHeader from packages/hoppscotch-data/dist/hoppscotch-data.js on your end.

<!-- gh-comment-id:2864132460 --> @g3Bg2 commented on GitHub (May 8, 2025): Yes. Working perfectly fine on my end. When you do `pnpm install` from the main dir, it should generate the build files in hoppscotch-data. Also, check if it is exporting calculateHawkHeader from packages/hoppscotch-data/dist/hoppscotch-data.js on your end.
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#1925
No description provided.