[GH-ISSUE #4178] [bug]: MacOS tauri build fail #1509

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

Originally created by @maxktz on GitHub (Jul 9, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4178

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

This may be related:
https://github.com/hoppscotch/hoppscotch/issues/2717

When I'm trying to run desktop application using pnpm tauri dev an error happens:

❯ pnpm tauri dev

> @hoppscotch/selfhost-desktop@2024.6.0 tauri /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop
> tauri "dev"

     Running BeforeDevCommand (`pnpm dev`)

> @hoppscotch/selfhost-desktop@2024.6.0 dev /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop
> pnpm exec npm-run-all -p -l dev:*

[dev:gql-codegen] 
[dev:gql-codegen] > @hoppscotch/selfhost-desktop@2024.6.0 dev:gql-codegen /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop
[dev:gql-codegen] > graphql-codegen --require dotenv/config --config gql-codegen.yml dotenv_config_path="../../.env" --watch
[dev:gql-codegen] 
[dev:vite       ] 
[dev:vite       ] > @hoppscotch/selfhost-desktop@2024.6.0 dev:vite /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop
[dev:vite       ] > vite
[dev:vite       ] 
        Warn Waiting for your frontend dev server to start on http://localhost:3000/...
[dev:gql-codegen] [STARTED] Parse Configuration
[dev:gql-codegen] [SUCCESS] Parse Configuration
[dev:gql-codegen] [STARTED] Generate outputs
[dev:gql-codegen] [STARTED] Generate to src/api/generated/graphql.ts
[dev:gql-codegen] [STARTED] Generate to src/api/generated/backend-schema.json
[dev:gql-codegen] [STARTED] Load GraphQL schemas
[dev:gql-codegen] [STARTED] Load GraphQL schemas
[dev:gql-codegen] [SUCCESS] Load GraphQL schemas
[dev:gql-codegen] [SUCCESS] Load GraphQL schemas
[dev:gql-codegen] [STARTED] Load GraphQL documents
[dev:gql-codegen] [STARTED] Load GraphQL documents
[dev:gql-codegen] [SUCCESS] Load GraphQL documents
[dev:gql-codegen] [STARTED] Generate
[dev:gql-codegen] [SUCCESS] Generate
[dev:gql-codegen] [SUCCESS] Generate to src/api/generated/backend-schema.json
[dev:gql-codegen] [SUCCESS] Load GraphQL documents
[dev:gql-codegen] [STARTED] Generate
[dev:vite       ] [vite-plugin-static-copy] No items found.
[dev:vite       ] 
[dev:vite       ]   VITE v4.5.0  ready in 595 ms
[dev:vite       ] 
[dev:vite       ]   ➜  Local:   http://localhost:3000/
[dev:vite       ]   ➜  Network: use --host to expose
[dev:vite       ]   ➜  Inspect: http://localhost:3000/__inspect/
[dev:gql-codegen] [SUCCESS] Generate
[dev:gql-codegen] [SUCCESS] Generate to src/api/generated/graphql.ts
[dev:gql-codegen] [SUCCESS] Generate outputs
[dev:gql-codegen]   Parcel watcher not found. To use this feature, please make sure to provide @parcel/watcher as a peer dependency.
        Info Watching /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/src-tauri for changes...
   Compiling proc-macro2 v1.0.84
   ...
   Compiling tauri-plugin-deep-link v0.1.2 (https://github.com/FabianLars/tauri-plugin-deep-link?branch=main#1aa5c3d0)
   Compiling hoppscotch-desktop v24.6.0 (/Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/src-tauri)
   Compiling tauri-plugin-store v0.0.0 (https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e6)
   Compiling tauri-plugin-window-state v0.1.1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 37.13s
[dev:vite       ] Cannot read properties of undefined (reading 'endsWith')
[dev:vite       ] 1:26:24 AM [vite] Internal server error: Cannot read properties of undefined (reading 'endsWith')
[dev:vite       ]       at removeMaybeSuffix (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4189:12)
[dev:vite       ]       at /Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4198:13
[dev:vite       ]       at Array.map (<anonymous>)
[dev:vite       ]       at getSitemapLinks (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4197:276)
[dev:vite       ]       at generateSitemap (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4260:3)
[dev:vite       ]       at Object.onRoutesGenerated (file:///Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/vite.config.ts.timestamp-1720563941101-7940225f9f5cd.mjs:198:16)
[dev:vite       ]       at computeVueRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:514:90)
[dev:vite       ]       at resolveVueRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:519:29)
[dev:vite       ]       at Object.resolveRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:558:14)
[dev:vite       ]       at PageContext.resolveRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:902:34)

And this is the app view:
image

Steps to reproduce

  1. git clone https://github.com/hoppscotch/hoppscotch.git
  2. cd hoppscotch/packages/hoppscotch-selfhost-desktop
  3. nvm use 18
    Now using node v18.20.4 (npm v10.7.0)
  4. pnpm install
    ... Done in 46.1s
  5. pnpm tauri dev

Environment

❯ node --version
v18.20.4
❯ pnpm --version
9.4.0

I use Mac with an M1 chip

Version

Self-hosted

Originally created by @maxktz on GitHub (Jul 9, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4178 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior This may be related: https://github.com/hoppscotch/hoppscotch/issues/2717 When I'm trying to run desktop application using `pnpm tauri dev` an error happens: ```log ❯ pnpm tauri dev > @hoppscotch/selfhost-desktop@2024.6.0 tauri /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop > tauri "dev" Running BeforeDevCommand (`pnpm dev`) > @hoppscotch/selfhost-desktop@2024.6.0 dev /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop > pnpm exec npm-run-all -p -l dev:* [dev:gql-codegen] [dev:gql-codegen] > @hoppscotch/selfhost-desktop@2024.6.0 dev:gql-codegen /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop [dev:gql-codegen] > graphql-codegen --require dotenv/config --config gql-codegen.yml dotenv_config_path="../../.env" --watch [dev:gql-codegen] [dev:vite ] [dev:vite ] > @hoppscotch/selfhost-desktop@2024.6.0 dev:vite /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop [dev:vite ] > vite [dev:vite ] Warn Waiting for your frontend dev server to start on http://localhost:3000/... [dev:gql-codegen] [STARTED] Parse Configuration [dev:gql-codegen] [SUCCESS] Parse Configuration [dev:gql-codegen] [STARTED] Generate outputs [dev:gql-codegen] [STARTED] Generate to src/api/generated/graphql.ts [dev:gql-codegen] [STARTED] Generate to src/api/generated/backend-schema.json [dev:gql-codegen] [STARTED] Load GraphQL schemas [dev:gql-codegen] [STARTED] Load GraphQL schemas [dev:gql-codegen] [SUCCESS] Load GraphQL schemas [dev:gql-codegen] [SUCCESS] Load GraphQL schemas [dev:gql-codegen] [STARTED] Load GraphQL documents [dev:gql-codegen] [STARTED] Load GraphQL documents [dev:gql-codegen] [SUCCESS] Load GraphQL documents [dev:gql-codegen] [STARTED] Generate [dev:gql-codegen] [SUCCESS] Generate [dev:gql-codegen] [SUCCESS] Generate to src/api/generated/backend-schema.json [dev:gql-codegen] [SUCCESS] Load GraphQL documents [dev:gql-codegen] [STARTED] Generate [dev:vite ] [vite-plugin-static-copy] No items found. [dev:vite ] [dev:vite ] VITE v4.5.0 ready in 595 ms [dev:vite ] [dev:vite ] ➜ Local: http://localhost:3000/ [dev:vite ] ➜ Network: use --host to expose [dev:vite ] ➜ Inspect: http://localhost:3000/__inspect/ [dev:gql-codegen] [SUCCESS] Generate [dev:gql-codegen] [SUCCESS] Generate to src/api/generated/graphql.ts [dev:gql-codegen] [SUCCESS] Generate outputs [dev:gql-codegen] Parcel watcher not found. To use this feature, please make sure to provide @parcel/watcher as a peer dependency. Info Watching /Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/src-tauri for changes... Compiling proc-macro2 v1.0.84 ... Compiling tauri-plugin-deep-link v0.1.2 (https://github.com/FabianLars/tauri-plugin-deep-link?branch=main#1aa5c3d0) Compiling hoppscotch-desktop v24.6.0 (/Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/src-tauri) Compiling tauri-plugin-store v0.0.0 (https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e6) Compiling tauri-plugin-window-state v0.1.1 Finished `dev` profile [unoptimized + debuginfo] target(s) in 37.13s [dev:vite ] Cannot read properties of undefined (reading 'endsWith') [dev:vite ] 1:26:24 AM [vite] Internal server error: Cannot read properties of undefined (reading 'endsWith') [dev:vite ] at removeMaybeSuffix (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4189:12) [dev:vite ] at /Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4198:13 [dev:vite ] at Array.map (<anonymous>) [dev:vite ] at getSitemapLinks (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4197:276) [dev:vite ] at generateSitemap (/Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4260:3) [dev:vite ] at Object.onRoutesGenerated (file:///Users/zrxmax/dev/hoppscotch/packages/hoppscotch-selfhost-desktop/vite.config.ts.timestamp-1720563941101-7940225f9f5cd.mjs:198:16) [dev:vite ] at computeVueRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:514:90) [dev:vite ] at resolveVueRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:519:29) [dev:vite ] at Object.resolveRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:558:14) [dev:vite ] at PageContext.resolveRoutes (file:///Users/zrxmax/dev/hoppscotch/node_modules/.pnpm/vite-plugin-pages@0.26.0_@vue+compiler-sfc@3.3.10_vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.31.0_/node_modules/vite-plugin-pages/dist/index.mjs:902:34) ``` And this is the app view: ![image](https://github.com/hoppscotch/hoppscotch/assets/109878406/01a9a917-7e28-4182-8f6b-c555fe6735ab) ### Steps to reproduce 1. `git clone https://github.com/hoppscotch/hoppscotch.git` 2. `cd hoppscotch/packages/hoppscotch-selfhost-desktop` 3. `nvm use 18` ```Now using node v18.20.4 (npm v10.7.0)``` 4. `pnpm install` ```... Done in 46.1s``` 5. `pnpm tauri dev` ### Environment ``` ❯ node --version v18.20.4 ❯ pnpm --version 9.4.0 ``` I use Mac with an M1 chip ### Version Self-hosted
kerem 2026-03-16 20:37:50 +03:00
Author
Owner

@shipko commented on GitHub (Jul 10, 2024):

Please, try 20 version of nodejs

<!-- gh-comment-id:2219784822 --> @shipko commented on GitHub (Jul 10, 2024): Please, try 20 version of nodejs
Author
Owner

@maxktz commented on GitHub (Jul 11, 2024):

Please, try 20 version of nodejs

I have tried other versions before:

v16.20.2
v18.20.4
v20.9.0
v20.12.2
v21.2.0
v22.2.0

But I get the same error

Same steps to reproduce, changed only nvm use <version>:

<!-- gh-comment-id:2222018074 --> @maxktz commented on GitHub (Jul 11, 2024): > Please, try 20 version of nodejs I have tried other versions before: v16.20.2 v18.20.4 v20.9.0 v20.12.2 v21.2.0 v22.2.0 But I get the same error Same steps to reproduce, changed only `nvm use <version>`:
Author
Owner

@4innocent commented on GitHub (Aug 8, 2024):

just change this in vite.config.ts.
from
const ENV = loadEnv("development", path.resolve(__dirname, "../../"), ["VITE_"])
to
const ENV = loadEnv("example", path.resolve(__dirname, "../../"), ["VITE_"])

<!-- gh-comment-id:2275005470 --> @4innocent commented on GitHub (Aug 8, 2024): just change this in vite.config.ts. from `const ENV = loadEnv("development", path.resolve(__dirname, "../../"), ["VITE_"])` to `const ENV = loadEnv("example", path.resolve(__dirname, "../../"), ["VITE_"])`
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#1509
No description provided.