[GH-ISSUE #4091] [bug]: Desktop app build error using tauri #1463

Closed
opened 2026-03-16 20:24:55 +03:00 by kerem · 3 comments
Owner

Originally created by @ImNicolasTheDev on GitHub (May 27, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4091

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Version : hoppscotch-release-2024.3.2

When I try to build the desktop app using tauri (pnpm tauri build in packages/hoppscotch-selfhost-desktop/), I see this error :

pnpm tauri build

> @hoppscotch/selfhost-desktop@2024.3.2 tauri C:\Users\Public\Documents\Hoppscotch\packages\hoppscotch-selfhost-desktop
> tauri "build"

     Running beforeBuildCommand `pnpm build`

> @hoppscotch/selfhost-desktop@2024.3.2 build C:\Users\Public\Documents\Hoppscotch\packages\hoppscotch-selfhost-desktop
> node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build

vite v4.5.0 building for production...
✓ 14 modules transformed.
[vite-plugin-pwa:build] [vite]: Rollup failed to resolve import "@hoppscotch/data" from "C:/Users/Public/Documents/Hoppscotch/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.platform.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "@hoppscotch/data" from "C:/Users/Public/Documents/Hoppscotch/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.platform.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48216:27)
    at onRollupWarning (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48248:9)
    at onwarn (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:47976:13)
    at file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24276:13
    at Object.logger [as onLog] (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:25950:9)
    at ModuleLoader.handleInvalidResolvedId (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24862:26)
    at file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24822:26
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ELIFECYCLE  Command failed with exit code 1.
       Error beforeBuildCommand `pnpm build` failed with exit code 1
 ELIFECYCLE  Command failed with exit code 1.

Steps to reproduce

  1. Clone Hoppscotch version hoppscotch-release-2024.3.2
  2. Install all dependencies and run all scripts using pnpm install at the root of the project
  3. Go to packages/desktop-selfhost-desktop
  4. Run pnpm tauri build
  5. See the error

Environment

Release

Version

Local

Originally created by @ImNicolasTheDev on GitHub (May 27, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4091 ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current behavior Version : _hoppscotch-release-2024.3.2_ When I try to build the desktop app using tauri (`pnpm tauri build` in `packages/hoppscotch-selfhost-desktop/`), I see this error : ``` pnpm tauri build > @hoppscotch/selfhost-desktop@2024.3.2 tauri C:\Users\Public\Documents\Hoppscotch\packages\hoppscotch-selfhost-desktop > tauri "build" Running beforeBuildCommand `pnpm build` > @hoppscotch/selfhost-desktop@2024.3.2 build C:\Users\Public\Documents\Hoppscotch\packages\hoppscotch-selfhost-desktop > node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build vite v4.5.0 building for production... ✓ 14 modules transformed. [vite-plugin-pwa:build] [vite]: Rollup failed to resolve import "@hoppscotch/data" from "C:/Users/Public/Documents/Hoppscotch/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.platform.ts". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to `build.rollupOptions.external` error during build: Error: [vite]: Rollup failed to resolve import "@hoppscotch/data" from "C:/Users/Public/Documents/Hoppscotch/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.platform.ts". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to `build.rollupOptions.external` at viteWarn (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48216:27) at onRollupWarning (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48248:9) at onwarn (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.27.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:47976:13) at file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24276:13 at Object.logger [as onLog] (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:25950:9) at ModuleLoader.handleInvalidResolvedId (file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24862:26) at file:///C:/Users/Public/Documents/Hoppscotch/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24822:26 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)  ELIFECYCLE  Command failed with exit code 1. Error beforeBuildCommand `pnpm build` failed with exit code 1  ELIFECYCLE  Command failed with exit code 1. ``` ### Steps to reproduce 1. Clone Hoppscotch version _hoppscotch-release-2024.3.2_ 2. Install all dependencies and run all scripts using `pnpm install` at the root of the project 3. Go to `packages/desktop-selfhost-desktop` 4. Run `pnpm tauri build` 5. See the error ### Environment Release ### Version Local
kerem 2026-03-16 20:24:55 +03:00
Author
Owner

@ImNicolasTheDev commented on GitHub (May 27, 2024):

It must be related to the way @hoppscotch/data is imported, maybe something (like an alias) should be added in vite.config.ts ? Any help would be appreciated!

<!-- gh-comment-id:2133442276 --> @ImNicolasTheDev commented on GitHub (May 27, 2024): It must be related to the way `@hoppscotch/data` is imported, maybe something (like an alias) should be added in `vite.config.ts` ? Any help would be appreciated!
Author
Owner

@xTudoS commented on GitHub (Jun 2, 2024):

just add "@hoppscotch/data": "workspace:^", to your package.json and it should do it

<!-- gh-comment-id:2143714566 --> @xTudoS commented on GitHub (Jun 2, 2024): just add "@hoppscotch/data": "workspace:^", to your package.json and it should do it
Author
Owner

@ImNicolasTheDev commented on GitHub (Jun 3, 2024):

just add "@hoppscotch/data": "workspace:^", to your package.json and it should do it

There was indeed a misconfiguration. Thank you for your help! 😄
I will close this issue when the PR is accepted.

<!-- gh-comment-id:2144542992 --> @ImNicolasTheDev commented on GitHub (Jun 3, 2024): > just add "@hoppscotch/data": "workspace:^", to your package.json and it should do it There was indeed a misconfiguration. Thank you for your help! 😄 I will close this issue when the PR is accepted.
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#1463
No description provided.