ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
13.03k stars 1.22k forks source link

Build fails in WSL #104

Closed kirilan closed 3 months ago

kirilan commented 3 months ago

Describe the bug Build fails in Windows WSL with default settings

To Reproduce Steps to reproduce the behavior:

clone the repo in WSL (ubuntu server 22.04) edit the config and only add the default ollama URL (or localhost for that matter)

Expected behavior I expect to build and start the docker containers

Screenshots logs below

Additional context kiril@ROGM16:/mnt/c/Users/kiril/Perplexica$ docker compose up -d [+] Building 17.8s (9/9) FINISHED docker:default => [perplexica-frontend internal] load build definition from app.dockerfile 0.0s => => transferring dockerfile: 308B 0.0s => [perplexica-frontend internal] load metadata for docker.io/library/node:alpine 0.7s => [perplexica-frontend internal] load .dockerignore 0.0s => => transferring context: 55B 0.0s => [perplexica-frontend 1/5] FROM docker.io/library/node:alpine@sha256:916b42f9e83466eb17d60a441a96f5cd57033bbfe 0.0s => [perplexica-frontend internal] load build context 0.1s => => transferring context: 259.35kB 0.1s => CACHED [perplexica-frontend 2/5] WORKDIR /home/perplexica 0.0s => CACHED [perplexica-frontend 3/5] COPY ui /home/perplexica/ 0.0s => CACHED [perplexica-frontend 4/5] RUN yarn install 0.0s => ERROR [perplexica-frontend 5/5] RUN yarn build 16.9s

[perplexica-frontend 5/5] RUN yarn build: 0.294 yarn run v1.22.19 0.312 $ next build 0.695 Attention: Next.js now collects completely anonymous telemetry regarding usage. 0.695 This information is used to shape Next.js' roadmap and prioritize features. 0.695 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: 0.695 https://nextjs.org/telemetry 0.695 0.760 ▲ Next.js 14.1.4 0.760 0.811 Creating an optimized production build ... 1.952 (node:41) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. 1.952 (Use node --trace-deprecation ... to show where the warning was created) 8.323 (node:127) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. 8.323 (Use node --trace-warnings ... to show where the warning was created) 8.576 (node:127) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. 13.33 ✓ Compiled successfully 13.33 Linting and checking validity of types ... 15.89 Collecting page data ... 16.53 Generating static pages (0/6) ... Generating static pages (1/6) Generating static pages (2/6) Generating static pages (4/6) 16.77 ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout 16.77 at a (/home/perplexica/.next/server/chunks/853.js:46:11063) 16.77 at m (/home/perplexica/.next/server/chunks/853.js:46:22816) 16.77 at lt (/home/perplexica/.next/server/app/page.js:20:48143) 16.77 at nM (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:47422) 16.77 at nM (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:61666) 16.77 at nL (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64677) 16.77 at nB (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:67660) 16.77 at nM (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:58554) 16.77 at nL (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64677) 16.77 at nB (/home/perplexica/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:67660) 16.77 16.77 Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error 16.77 ✓ Generating static pages (6/6) 16.79 16.79 > Export encountered errors on following paths: 16.79 /page: / 16.83 error Command failed with exit code 1. 16.83 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1 kiril@ROGM16:/mnt/c/Users/kiril/Perplexica$

kirilan commented 3 months ago

weirdly enough I tried the build on a Debian Server and got another error on the same step. This time I decided to try to only configure a GROQ key and no Ollama.

kiril@deb01:~/Perplexica$ docker compose up -d [+] Building 42.5s (13/14) docker:default => [perplexica-backend internal] load build definition from backend.dockerfile 0.1s => => transferring dockerfile: 440B 0.0s => [perplexica-backend internal] load metadata for docker.io/library/node:buster-slim 11.1s => [perplexica-backend internal] load .dockerignore 0.1s => => transferring context: 55B 0.0s => [perplexica-backend 1/10] FROM docker.io/library/node:buster-slim@sha256:6b9c7110d38cfe71967ba3154c8e32bca078783402b3b801a81dcf9b 0.0s => [perplexica-backend internal] load build context 0.1s => => transferring context: 1.65kB 0.0s => CACHED [perplexica-backend 2/10] WORKDIR /home/perplexica 0.0s => CACHED [perplexica-backend 3/10] COPY src /home/perplexica/src 0.0s => CACHED [perplexica-backend 4/10] COPY tsconfig.json /home/perplexica/ 0.0s => CACHED [perplexica-backend 5/10] COPY config.toml /home/perplexica/ 0.0s => CACHED [perplexica-backend 6/10] COPY package.json /home/perplexica/ 0.0s => CACHED [perplexica-backend 7/10] COPY yarn.lock /home/perplexica/ 0.0s => CACHED [perplexica-backend 8/10] RUN sed -i "s|SEARXNG = ".*"|SEARXNG = "http://searxng:8080"|g" /home/perplexica/config.toml 0.0s => ERROR [perplexica-backend 9/10] RUN yarn install 30.8s

[perplexica-backend 9/10] RUN yarn install: 0.769 yarn install v1.22.19 0.819 [1/4] Resolving packages... 0.915 [2/4] Fetching packages... 22.34 [3/4] Linking dependencies... 22.34 warning " > ts-node@10.9.2" has unmet peer dependency "@types/node@*". 24.86 [4/4] Building fresh packages... 30.27 error /home/perplexica/node_modules/sharp: Command failed. 30.27 Exit code: 1 30.27 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) 30.27 Arguments: 30.27 Directory: /home/perplexica/node_modules/sharp 30.27 Output: 30.27 sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linux-x64.tar.br 30.27 sharp: Installation error: Request timed out 30.27 sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies 30.27 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1 kiril@deb01:~/Perplexica$

ItzCrazyKns commented 3 months ago

Fixed in https://github.com/ItzCrazyKns/Perplexica/commit/c852bee8ed99092d7956b913bdd611ddb8eca300. Re-clone Perplexica and try building again

kirilan commented 3 months ago

weirdly enough I still get the same error. I definitely see the updated page.tsx is getting downloaded but the error is still here

` => [perplexica-backend 8/10] RUN sed -i "s|SEARXNG = ".*"|SEARXNG = "http://searxng:8080"|g" /home/perplexica/config.toml 0.8s => ERROR [perplexica-backend 9/10] RUN yarn install 30.7s

[perplexica-backend 9/10] RUN yarn install: 0.874 yarn install v1.22.19 0.916 [1/4] Resolving packages... 1.024 [2/4] Fetching packages... 21.58 [3/4] Linking dependencies... 21.58 warning " > ts-node@10.9.2" has unmet peer dependency "@types/node@*". 23.77 [4/4] Building fresh packages... 29.26 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. 29.26 error /home/perplexica/node_modules/sharp: Command failed. 29.26 Exit code: 1 29.26 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) 29.26 Arguments: 29.26 Directory: /home/perplexica/node_modules/sharp 29.26 Output: 29.26 sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linux-x64.tar.br 29.26 sharp: Installation error: Request timed out 29.26 sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies

failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1 kiril@deb01:~/Perplexica$ cd ui/app/ kiril@deb01:~/Perplexica/ui/app$ cat page.tsx import ChatWindow from '@/components/ChatWindow'; import { Metadata } from 'next'; import { Suspense } from 'react';

export const metadata: Metadata = { title: 'Chat - Perplexica', description: 'Chat with the internet, chat with Perplexica.', };

const Home = () => { return (

); };

export default Home; kiril@deb01:~/Perplexica/ui/app$`

kirilan commented 3 months ago

actually it now builds normally on WSL, but it fails on Debian which is probably a completely separate issue.

Thank you @ItzCrazyKns