ViewTube / viewtube

▶️ ViewTube: The open source, privacy-conscious way to enjoy your favorite YouTube content. Docs: https://viewtube.wiki, Status: https://uptime.viewtube.io
https://viewtube.io
GNU Affero General Public License v3.0
1.33k stars 77 forks source link

Docker Bug #2968

Open apurbapathak opened 2 months ago

apurbapathak commented 2 months ago

33.67 server build: > SWC Running... 35.00 server build: Successfully compiled: 209 files with swc (346.63ms) 35.75 server build: Done 46.02 client build: ℹ ✓ 889 modules transformed. 46.03 client build: ERROR x Build failed in 25.02s 46.03 client build: ERROR Nuxt Build Error: [vite:load-fallback] Could not load /home/build/client/buildMetadata.json (imported by app/components/About.vue?vue&type=script&setup=true&lang.ts): ENOENT: no such file or directory, open '/home/build/client/buildMetadata.json' 46.03 client build: at async open (node:internal/fs/promises:639:25) 46.03 client build: at async Object.readFile (node:internal/fs/promises:1242:14) 46.03 client build: at async Object.load (/home/build/nodemodules/.pnpm/vite@5.3.4@types+node@20.14.12_sass@1.77.8_terser@5.31.3/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:65386:25) 46.03 client build: at async PluginDriver.hookFirstAndGetPlugin (/home/build/node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:19708:28) 46.03 client build: at async /home/build/node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:18879:33 46.03 client build: at async Queue.work (/home/build/node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:19918:32) 61.24 client build: app/components/About.vue(5,53): error TS2307: Cannot find module '~~/buildMetadata.json' or its corresponding type declarations. 61.38 client build: Failed 61.39 /home/build/client: 61.39  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @viewtube/client@ build: cross-env NUXT_BUILD=true nuxi build 61.39 Exit status 1 61.44  ELIFECYCLE  Command failed with exit code 1.

failed to solve: process "/bin/sh -c pnpm run build" did not complete successfully: exit code: 1 root@vmi2090944:/www/wwwroot/viewtube#

jayp76 commented 1 month ago

same here

gareins commented 1 month ago

So I have no idea when this was broken, I think the authors just use the github tools as its done outside the docker build in .github/workflows/build-workflow.yml so dockerfile creating should work if the buildMetadata.json is prebuilt.

Anyway I fixed this by removing .git from .dockerignore and then manually calling the build step that builds this file, so in Dockerfile just before RUN pnpm run build add this line: RUN pnpm run build:metadata.

I am first time around these parts, if the authors wanna chime in on how to properly solve this, I would be happy :)