[GH-ISSUE #4753] [bug]: docker build [vite-plugin-pwa:build] Could not load virtual:vite-plugin-pages/generated-pages?id=virtual:generated-pages #1778

Closed
opened 2026-03-16 21:42:22 +03:00 by kerem · 4 comments
Owner

Originally created by @a-super-admin on GitHub (Feb 13, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4753

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I do docker build -t myhoppscotch -f prod.Dockerfile . the build fails with github.com/hoppscotch/hoppscotch@35a471f120.

Also, is this for the AIO version?

[...]
 => [caddy_builder 10/11] WORKDIR /tmp/caddy-build/cmd/caddy                                                                                                                                                                  0.5s
 => [caddy_builder 11/11] RUN go build                                                                                                                                                                                       35.3s
 => [base_builder  9/10] COPY . .                                                                                                                                                                                             7.0s
 => [base_builder 10/10] RUN pnpm install -f --offline                                                                                                                                                                      215.1s
 => [aio  4/18] COPY --from=caddy_builder /tmp/caddy-build/cmd/caddy/caddy /usr/bin/caddy                                                                                                                                     0.3s
 => [aio  5/18] RUN apk add tini                                                                                                                                                                                              0.9s
 => [aio  6/18] RUN npm install -g pnpm@10.2.1                                                                                                                                                                                4.4s
 => [backend_builder 1/6] WORKDIR /usr/src/app/packages/hoppscotch-backend                                                                                                                                                    0.2s
 => [sh_admin_builder 1/3] WORKDIR /usr/src/app/packages/hoppscotch-sh-admin                                                                                                                                                  0.4s
 => [fe_builder 1/2] WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web                                                                                                                                                    0.3s
 => [aio  7/18] COPY --from=base_builder /usr/src/app/packages/hoppscotch-backend/backend.Caddyfile /etc/caddy/backend.Caddyfile                                                                                              0.4s
 => [backend_builder 2/6] RUN pnpm exec prisma generate                                                                                                                                                                       2.2s
 => ERROR [fe_builder 2/2] RUN pnpm run generate                                                                                                                                                                              6.6s
 => CANCELED [sh_admin_builder 2/3] RUN pnpm run build --outDir dist-multiport-setup                                                                                                                                          6.8s
 => CANCELED [backend_builder 3/6] RUN pnpm run build                                                                                                                                                                         4.7s
------
 > [fe_builder 2/2] RUN pnpm run generate:
0.890 
0.890 > @hoppscotch/selfhost-web@2025.1.1 generate /usr/src/app/packages/hoppscotch-selfhost-web
0.890 > pnpm run build
0.890 
1.343 
1.343 > @hoppscotch/selfhost-web@2025.1.1 build /usr/src/app/packages/hoppscotch-selfhost-web
1.343 > node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build
1.343 
2.091 vite v5.4.9 building for production...
2.345 transforming...
3.316 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
3.316 
3.316 More info and automated migrator: https://sass-lang.com/d/import
3.316 
3.316   ╷
3.316 1 │ @import "./base-themes.scss";
3.316   │         ^^^^^^^^^^^^^^^^^^^^
3.316   ╵
3.316     ../hoppscotch-common/assets/themes/themes.scss 1:9  root stylesheet
3.316 
3.318 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
3.318 
3.318 More info and automated migrator: https://sass-lang.com/d/import
3.318 
3.318   ╷
3.318 2 │ @import "./editor-themes.scss";
3.318   │         ^^^^^^^^^^^^^^^^^^^^^^
3.318   ╵
3.318     ../hoppscotch-common/assets/themes/themes.scss 2:9  root stylesheet
3.318 
3.319 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
3.319 
3.319 More info and automated migrator: https://sass-lang.com/d/import
3.319 
3.319   ╷
3.319 3 │ @import "./accent-themes.scss";
3.319   │         ^^^^^^^^^^^^^^^^^^^^^^
3.319   ╵
3.319     ../hoppscotch-common/assets/themes/themes.scss 3:9  root stylesheet
3.319 
6.504 
6.504 import-meta-env v0.6.0
6.504 ✓ environment files are generated.
6.504 Remember to inject (`npx import-meta-env`) environment variables before serving your application.
6.504 
6.505 ✓ 825 modules transformed.
6.505 x Build failed in 4.20s
6.505 error during build:
6.505 [vite-plugin-pwa:build] Could not load virtual:vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith')
6.505     at removeMaybeSuffix (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:44:12)
6.505     at file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:53:20
6.505     at Array.map (<anonymous>)
6.505     at getSitemapLinks (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:52:276)
6.505     at generateSitemap (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:129:3)
6.505     at Object.onRoutesGenerated (file:///usr/src/app/packages/hoppscotch-selfhost-web/vite.config.ts.timestamp-1739440702968-38084771ab042.mjs:221:9)
6.505     at computeVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:460:90)
6.505     at resolveVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:465:29)
6.505     at Object.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:504:14)
6.505     at PageContext.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:855:34)
6.545  ELIFECYCLE  Command failed with exit code 1.
6.558  ELIFECYCLE  Command failed with exit code 1.
------

 1 warning found (use docker --debug to expand):
 - UndefinedVar: Usage of undefined variable '$DATABASE_URL' (line 175)
prod.Dockerfile:92
--------------------
  90 |     FROM base_builder AS fe_builder
  91 |     WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web
  92 | >>> RUN pnpm run generate
  93 |     
  94 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c pnpm run generate" did not complete successfully: exit code: 1

Steps to reproduce

docker build -t myhoppscotch -f prod.Dockerfile .

Environment

Production

Version

Self-hosted

Originally created by @a-super-admin on GitHub (Feb 13, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4753 ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current behavior When I do `docker build -t myhoppscotch -f prod.Dockerfile .` the build fails with https://github.com/hoppscotch/hoppscotch/commit/35a471f1208e54433a0c8967d99257e92bc32e5a. Also, is this for the AIO version? ``` [...] => [caddy_builder 10/11] WORKDIR /tmp/caddy-build/cmd/caddy 0.5s => [caddy_builder 11/11] RUN go build 35.3s => [base_builder 9/10] COPY . . 7.0s => [base_builder 10/10] RUN pnpm install -f --offline 215.1s => [aio 4/18] COPY --from=caddy_builder /tmp/caddy-build/cmd/caddy/caddy /usr/bin/caddy 0.3s => [aio 5/18] RUN apk add tini 0.9s => [aio 6/18] RUN npm install -g pnpm@10.2.1 4.4s => [backend_builder 1/6] WORKDIR /usr/src/app/packages/hoppscotch-backend 0.2s => [sh_admin_builder 1/3] WORKDIR /usr/src/app/packages/hoppscotch-sh-admin 0.4s => [fe_builder 1/2] WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web 0.3s => [aio 7/18] COPY --from=base_builder /usr/src/app/packages/hoppscotch-backend/backend.Caddyfile /etc/caddy/backend.Caddyfile 0.4s => [backend_builder 2/6] RUN pnpm exec prisma generate 2.2s => ERROR [fe_builder 2/2] RUN pnpm run generate 6.6s => CANCELED [sh_admin_builder 2/3] RUN pnpm run build --outDir dist-multiport-setup 6.8s => CANCELED [backend_builder 3/6] RUN pnpm run build 4.7s ------ > [fe_builder 2/2] RUN pnpm run generate: 0.890 0.890 > @hoppscotch/selfhost-web@2025.1.1 generate /usr/src/app/packages/hoppscotch-selfhost-web 0.890 > pnpm run build 0.890 1.343 1.343 > @hoppscotch/selfhost-web@2025.1.1 build /usr/src/app/packages/hoppscotch-selfhost-web 1.343 > node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build 1.343 2.091 vite v5.4.9 building for production... 2.345 transforming... 3.316 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. 3.316 3.316 More info and automated migrator: https://sass-lang.com/d/import 3.316 3.316 ╷ 3.316 1 │ @import "./base-themes.scss"; 3.316 │ ^^^^^^^^^^^^^^^^^^^^ 3.316 ╵ 3.316 ../hoppscotch-common/assets/themes/themes.scss 1:9 root stylesheet 3.316 3.318 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. 3.318 3.318 More info and automated migrator: https://sass-lang.com/d/import 3.318 3.318 ╷ 3.318 2 │ @import "./editor-themes.scss"; 3.318 │ ^^^^^^^^^^^^^^^^^^^^^^ 3.318 ╵ 3.318 ../hoppscotch-common/assets/themes/themes.scss 2:9 root stylesheet 3.318 3.319 DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. 3.319 3.319 More info and automated migrator: https://sass-lang.com/d/import 3.319 3.319 ╷ 3.319 3 │ @import "./accent-themes.scss"; 3.319 │ ^^^^^^^^^^^^^^^^^^^^^^ 3.319 ╵ 3.319 ../hoppscotch-common/assets/themes/themes.scss 3:9 root stylesheet 3.319 6.504 6.504 import-meta-env v0.6.0 6.504 ✓ environment files are generated. 6.504 Remember to inject (`npx import-meta-env`) environment variables before serving your application. 6.504 6.505 ✓ 825 modules transformed. 6.505 x Build failed in 4.20s 6.505 error during build: 6.505 [vite-plugin-pwa:build] Could not load virtual:vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith') 6.505 at removeMaybeSuffix (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:44:12) 6.505 at file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:53:20 6.505 at Array.map (<anonymous>) 6.505 at getSitemapLinks (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:52:276) 6.505 at generateSitemap (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.7.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:129:3) 6.505 at Object.onRoutesGenerated (file:///usr/src/app/packages/hoppscotch-selfhost-web/vite.config.ts.timestamp-1739440702968-38084771ab042.mjs:221:9) 6.505 at computeVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:460:90) 6.505 at resolveVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:465:29) 6.505 at Object.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:504:14) 6.505 at PageContext.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.32.3_@vue+compiler-sfc@3.5.12_vite@5.4.9_@types+node@22.7.6_sass@1._982e439e03fe9d943b4a96af4fafa979/node_modules/vite-plugin-pages/dist/index.js:855:34) 6.545  ELIFECYCLE  Command failed with exit code 1. 6.558  ELIFECYCLE  Command failed with exit code 1. ------ 1 warning found (use docker --debug to expand): - UndefinedVar: Usage of undefined variable '$DATABASE_URL' (line 175) prod.Dockerfile:92 -------------------- 90 | FROM base_builder AS fe_builder 91 | WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web 92 | >>> RUN pnpm run generate 93 | 94 | -------------------- ERROR: failed to solve: process "/bin/sh -c pnpm run generate" did not complete successfully: exit code: 1 ``` ### Steps to reproduce `docker build -t myhoppscotch -f prod.Dockerfile .` ### Environment Production ### Version Self-hosted
kerem 2026-03-16 21:42:22 +03:00
Author
Owner

@yousefmarey12 commented on GitHub (Feb 14, 2025):

I am getting this error as well with a simple pnpm dev on for the FE.

<!-- gh-comment-id:2660122704 --> @yousefmarey12 commented on GitHub (Feb 14, 2025): I am getting this error as well with a simple `pnpm dev` on for the FE.
Author
Owner

@chris-parker-za commented on GitHub (Feb 20, 2025):

Is there a branch that does indeed still build?

<!-- gh-comment-id:2670900890 --> @chris-parker-za commented on GitHub (Feb 20, 2025): Is there a branch that does indeed still build?
Author
Owner

@chris-parker-za commented on GitHub (Feb 21, 2025):

Figured it out. You need a .env file in your project - copy the .env.example and rename it to .env - edit as needed. That solves this issue

<!-- gh-comment-id:2674004438 --> @chris-parker-za commented on GitHub (Feb 21, 2025): Figured it out. You need a .env file in your project - copy the .env.example and rename it to .env - edit as needed. That solves this issue
Author
Owner

@mvhatch commented on GitHub (Feb 24, 2025):

@chris-parker-za - thank you! you saved my life

<!-- gh-comment-id:2679113134 --> @mvhatch commented on GitHub (Feb 24, 2025): @chris-parker-za - thank you! you saved my life
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#1778
No description provided.