jan icon indicating copy to clipboard operation
jan copied to clipboard

bug: [Docker mode, build failed]

Open Galigator opened this issue 5 months ago • 0 comments

Jan version

git, branch:dev, Tue Sep 3

Describe the Bug

Running docker compose --profile gpu-fs -f web/docker-compose.yml up result in failure of building the image.

There is a node dependency problem :

=> ERROR [web builder 5/5] RUN yarn build 19.9s

[web builder 5/5] RUN yarn build: 0.812 yarn run v1.22.22 0.836 $ next build 1.372 Attention: Next.js now collects completely anonymous telemetry regarding usage. 1.372 This information is used to shape Next.js' roadmap and prioritize features. 1.372 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: 1.372 https://nextjs.org/telemetry 1.372 1.426 ▲ Next.js 14.2.3 1.426 - Environments: .env 1.426 1.504 Creating an optimized production build ... 1.852 ⚠ Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled 11.24 ✓ Compiled successfully 11.24 Skipping linting 11.24 Checking validity of types ... 18.46 Failed to compile. 18.46 18.47 ./core/rollup.config.ts:5:18 18.47 Type error: Could not find a declaration file for module 'rollup-plugin-json'. '/app/node_modules/rollup-plugin-json/dist/rollup-plugin-json.cjs.js' implicitly has an 'any' type. 18.47 Try npm i --save-dev @types/rollup-plugin-json if it exists or add a new declaration (.d.ts) file containing declare module 'rollup-plugin-json'; 18.47 18.47 3 | import sourceMaps from 'rollup-plugin-sourcemaps' 18.47 4 | import typescript from 'rollup-plugin-typescript2' 18.47 > 5 | import json from 'rollup-plugin-json' 18.47 | ^ 18.47 6 | import replace from '@rollup/plugin-replace' 18.47 7 | 18.47 8 | const pkg = require('./package.json') 18.57 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 18.57 error Command failed with exit code 1.


failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1

Steps to Reproduce

$ node --version v20.17.0 $ yarn --version 1.22.22 $ make --version GNU Make 4.3 $ npm --version 10.8.2

git clone https://github.com/janhq/jan.git cd jan [edit] web/docker-compose.yml : -dockerfile: dev.Dockerfile +dockerfile: Dockerfile

create .env file : $ cat .env NEXT_PUBLIC_ENV=development NEXT_PUBLIC_WEB_URL= NEXT_PUBLIC_DISCORD_INVITATION_URL= NEXT_PUBLIC_DOWNLOAD_APP_IOS= NEXT_PUBLIC_DOWNLOAD_APP_ANDROID= NEXT_PUBLIC_GRAPHQL_ENGINE_URL= NEXT_PUBLIC_GRAPHQL_ENGINE_WEB_SOCKET_URL= KEYCLOAK_CLIENT_ID= KEYCLOAK_CLIENT_SECRET= AUTH_ISSUER= NEXTAUTH_URL= NEXTAUTH_SECRET= END_SESSION_URL= REFRESH_TOKEN_URL=

copy the .env file to /jan directory and /jan/web directory

from /jan directory run : docker compose --profile gpu-fs -f web/docker-compose.yml up

or from /jan/web directory run : docker compose --profile gpu-fs up

Alternatively, you can make dev, and/or make build, and copy one or all directory node_modules, joi, extensions to web to make the error change, but still dependency problems.

Screenshots / Logs

No response

What is your OS?

  • [ ] MacOS
  • [ ] Windows
  • [X] Linux

Galigator avatar Sep 10 '24 07:09 Galigator