[GH-ISSUE #4243] ERROR RUN pnpm run generate #1531

Closed
opened 2026-03-16 20:43:58 +03:00 by kerem · 2 comments
Owner

Originally created by @outradriss on GitHub (Aug 6, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4243

Hello,
I tried to run the image locally with branch main , but I encountered this error:

=> ERROR [fe_builder 2/2] RUN pnpm run generate 45.8s
=> CANCELED [sh_admin_builder 2/3] RUN pnpm run build --outDir dist-multiport-setup 46.2s
=> [backend 2/6] WORKDIR /usr/src/app/packages/hoppscotch-backend 0.1s
=> [backend 3/6] RUN pnpm exec prisma generate 10.4s
=> CANCELED [backend 4/6] RUN pnpm run build 24.8s

[fe_builder 2/2] RUN pnpm run generate:
3.522
3.522 > @hoppscotch/selfhost-web@2024.7.0 generate /usr/src/app/packages/hoppscotch-selfhost-web
3.522 > pnpm run build
3.522
7.431
7.431 > @hoppscotch/selfhost-web@2024.7.0 build /usr/src/app/packages/hoppscotch-selfhost-web
7.431 > node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build
7.431
12.80 vite v4.5.0 building for production...
14.05 transforming...
45.34
45.34 import-meta-env v0.4.10
45.34 ✓ environment files are generated.
45.34 Remember to inject (npx import-meta-env) environment variables before serving your application.
45.34
45.35 ✓ 987 modules transformed.
45.35 [vite-plugin-pwa:build] Could not load /@vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith')
45.35 error during build:
45.35 TypeError: Could not load /@vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith')
45.35 at removeMaybeSuffix (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4189:12)
45.35 at /usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4198:13
45.35 at Array.map ()
45.35 at getSitemapLinks (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4197:276)
45.35 at generateSitemap (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4260:3)
45.35 at Object.onRoutesGenerated (file:///usr/src/app/packages/hoppscotch-selfhost-web/vite.config.ts.timestamp-1722961977343-9a0de72ddbdb2.mjs:221:9)
45.35 at computeVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:543:90)
45.35 at resolveVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:548:29)
45.35 at Object.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:587:14)
45.35 at PageContext.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:936:34)
45.61  ELIFECYCLE  Command failed with exit code 1.
45.66  ELIFECYCLE  Command failed with exit code 1.

8 warnings found (use --debug to expand):

  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 18)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 34)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 38)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 49)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 55)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 68)
  • UndefinedVar: Usage of undefined variable '$DATABASE_URL' (line 29)
    prod.Dockerfile:36

34 | FROM base_builder as fe_builder
35 | WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web
36 | >>> RUN pnpm run generate
37 |
38 | FROM caddy:2-alpine as app

ERROR: failed to solve: process "/bin/sh -c pnpm run generate" did not complete successfully: exit code: 1

Do you have any ideas, please?

Originally created by @outradriss on GitHub (Aug 6, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4243 Hello, I tried to run the image locally with branch main , but I encountered this error: => ERROR [fe_builder 2/2] RUN pnpm run generate 45.8s => CANCELED [sh_admin_builder 2/3] RUN pnpm run build --outDir dist-multiport-setup 46.2s => [backend 2/6] WORKDIR /usr/src/app/packages/hoppscotch-backend 0.1s => [backend 3/6] RUN pnpm exec prisma generate 10.4s => CANCELED [backend 4/6] RUN pnpm run build 24.8s > [fe_builder 2/2] RUN pnpm run generate: 3.522 3.522 > @hoppscotch/selfhost-web@2024.7.0 generate /usr/src/app/packages/hoppscotch-selfhost-web 3.522 > pnpm run build 3.522 7.431 7.431 > @hoppscotch/selfhost-web@2024.7.0 build /usr/src/app/packages/hoppscotch-selfhost-web 7.431 > node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build 7.431 12.80 vite v4.5.0 building for production... 14.05 transforming... 45.34 45.34 import-meta-env v0.4.10 45.34 ✓ environment files are generated. 45.34 Remember to inject (`npx import-meta-env`) environment variables before serving your application. 45.34 45.35 ✓ 987 modules transformed. 45.35 [vite-plugin-pwa:build] Could not load /@vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith') 45.35 error during build: 45.35 TypeError: Could not load /@vite-plugin-pages/generated-pages?id=virtual:generated-pages (imported by ../hoppscotch-common/src/modules/router.ts): Cannot read properties of undefined (reading 'endsWith') 45.35 at removeMaybeSuffix (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4189:12) 45.35 at /usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4198:13 45.35 at Array.map (<anonymous>) 45.35 at getSitemapLinks (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4197:276) 45.35 at generateSitemap (/usr/src/app/node_modules/.pnpm/vite-plugin-pages-sitemap@1.6.1/node_modules/vite-plugin-pages-sitemap/dist/index.js:4260:3) 45.35 at Object.onRoutesGenerated (file:///usr/src/app/packages/hoppscotch-selfhost-web/vite.config.ts.timestamp-1722961977343-9a0de72ddbdb2.mjs:221:9) 45.35 at computeVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:543:90) 45.35 at resolveVueRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:548:29) 45.35 at Object.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:587:14) 45.35 at PageContext.resolveRoutes (file:///usr/src/app/node_modules/.pnpm/vite-plugin-pages@0.31.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:936:34) 45.61  ELIFECYCLE  Command failed with exit code 1. 45.66  ELIFECYCLE  Command failed with exit code 1. 8 warnings found (use --debug to expand): - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 18) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 34) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 38) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 49) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 55) - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 68) - UndefinedVar: Usage of undefined variable '$DATABASE_URL' (line 29) prod.Dockerfile:36 34 | FROM base_builder as fe_builder 35 | WORKDIR /usr/src/app/packages/hoppscotch-selfhost-web 36 | >>> RUN pnpm run generate 37 | 38 | FROM caddy:2-alpine as app ERROR: failed to solve: process "/bin/sh -c pnpm run generate" did not complete successfully: exit code: 1 Do you have any ideas, please?
kerem closed this issue 2026-03-16 20:44:04 +03:00
Author
Owner

@4innocent commented on GitHub (Aug 7, 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:2274195176 --> @4innocent commented on GitHub (Aug 7, 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_"])`
Author
Owner

@outradriss commented on GitHub (Aug 8, 2024):

Thanks @4innocent for the response, it helped me, but I have another issue with JWTStrategy when I try to run a container:

ERROR [ExceptionHandler] JwtStrategy requires a secret or key
2024-08-08 17:53:07 Backend Server | TypeError: JwtStrategy requires a secret or key
2024-08-08 17:53:07 Backend Server | at new JwtStrategy (/usr/src/app/node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/strategy.js:45:15)
2024-08-08 17:53:07 Backend Server | at new MixinStrategy (/usr/src/app/node_modules/.pnpm/@nestjs+passport@10.0.2_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1__owspyaltb3hygw66etzcv5nnwq/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:32:13)
2024-08-08 17:53:07 Backend Server | at new JwtStrategy (/usr/src/app/packages/hoppscotch-backend/dist/auth/strategies/jwt.strategy.js:22:9)
2024-08-08 17:53:07 Backend Server | at Injector.instantiateClass (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:365:19)
2024-08-08 17:53:07 Backend Server | at callback (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:65:45)
2024-08-08 17:53:07 Backend Server | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:144:24)
2024-08-08 17:53:07 Backend Server | at async Injector.loadInstance (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:70:13)
2024-08-08 17:53:07 Backend Server | at async Injector.loadProvider (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:97:9)
2024-08-08 17:53:07 Backend Server | at async /usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/instance-loader.js:56:13
2024-08-08 17:53:07 Backend Server | at async Promise.all (index 4)
2024-08-08 17:53:07 Backend Server | ELIFECYCLE  Command failed with exit code 1.

<!-- gh-comment-id:2276165071 --> @outradriss commented on GitHub (Aug 8, 2024): Thanks @4innocent for the response, it helped me, but I have another issue with JWTStrategy when I try to run a container: ERROR [ExceptionHandler] JwtStrategy requires a secret or key 2024-08-08 17:53:07 Backend Server | TypeError: JwtStrategy requires a secret or key 2024-08-08 17:53:07 Backend Server | at new JwtStrategy (/usr/src/app/node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/strategy.js:45:15) 2024-08-08 17:53:07 Backend Server | at new MixinStrategy (/usr/src/app/node_modules/.pnpm/@nestjs+passport@10.0.2_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1__owspyaltb3hygw66etzcv5nnwq/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:32:13) 2024-08-08 17:53:07 Backend Server | at new JwtStrategy (/usr/src/app/packages/hoppscotch-backend/dist/auth/strategies/jwt.strategy.js:22:9) 2024-08-08 17:53:07 Backend Server | at Injector.instantiateClass (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:365:19) 2024-08-08 17:53:07 Backend Server | at callback (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:65:45) 2024-08-08 17:53:07 Backend Server | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:144:24) 2024-08-08 17:53:07 Backend Server | at async Injector.loadInstance (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:70:13) 2024-08-08 17:53:07 Backend Server | at async Injector.loadProvider (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/injector.js:97:9) 2024-08-08 17:53:07 Backend Server | at async /usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/injector/instance-loader.js:56:13 2024-08-08 17:53:07 Backend Server | at async Promise.all (index 4) 2024-08-08 17:53:07 Backend Server | ELIFECYCLE  Command failed with exit code 1.
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#1531
No description provided.