mckaywrigley / chatbot-ui

Come join the best place on the internet to learn AI skills. Use code "chatbotui" for an extra 20% off.
https://JoinTakeoff.com
MIT License
28.63k stars 7.97k forks source link

Vercel build fails to compile #1371

Closed PrakrutR closed 8 months ago

PrakrutR commented 8 months ago

I am running a build on vercel however after some changes it refuses to complie

<html>
<body>
<!--StartFragment-->
./app/[locale]/[workspaceid]/layout.tsx
--
15:22:50.040 | 71:6  Warning: React Hook useEffect has missing dependencies: 'fetchWorkspaceData', 'router', and 'workspaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.040 | 88:6  Warning: React Hook useEffect has missing dependencies: 'fetchWorkspaceData', 'setChatFiles', 'setChatImages', 'setChatMessages', 'setFirstTokenReceived', 'setIsGenerating', 'setNewMessageFiles', 'setNewMessageImages', 'setSelectedChat', 'setShowFilesDisplay', and 'setUserInput'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.040 |  
15:22:50.040 | ./app/[locale]/login/password/page.tsx
15:22:50.040 | 23:6  Warning: React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.041 |  
15:22:50.041 | ./app/[locale]/setup/page.tsx
15:22:50.041 | 99:6  Warning: React Hook useEffect has missing dependencies: 'router', 'setAvailableHostedModels', 'setAvailableOpenRouterModels', 'setEnvKeyMap', and 'setProfile'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.041 |  
15:22:50.041 | ./components/chat/chat-hooks/use-scroll.tsx
15:22:50.041 | 22:6  Warning: React Hook useEffect has a missing dependency: 'userScrolled'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.042 | 28:6  Warning: React Hook useEffect has missing dependencies: 'isGenerating', 'scrollToBottom', and 'userScrolled'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.042 |  
15:22:50.042 | ./components/chat/chat-hooks/use-select-file-handler.tsx
15:22:50.042 | 33:6  Warning: React Hook useEffect has a missing dependency: 'handleFilesToAccept'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.042 |  
15:22:50.042 | ./components/chat/chat-input.tsx
15:22:50.044 | 70:6  Warning: React Hook useEffect has a missing dependency: 'handleFocusChatInput'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.046 |  
15:22:50.047 | ./components/chat/chat-settings.tsx
15:22:50.047 | 40:6  Warning: React Hook useEffect has missing dependencies: 'chatSettings' and 'setChatSettings'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.047 |  
15:22:50.047 | ./components/chat/chat-ui.tsx
15:22:50.050 | 75:6  Warning: React Hook useEffect has missing dependencies: 'fetchChat', 'fetchMessages', 'handleFocusChatInput', 'params.chatid', 'scrollToBottom', and 'setIsAtBottom'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.050 |  
15:22:50.051 | ./components/messages/message-markdown.tsx
15:22:50.051 | 21:18  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
15:22:50.051 | 21:18  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
15:22:50.051 |  
15:22:50.051 | ./components/messages/message.tsx
15:22:50.051 | 128:6  Warning: React Hook useEffect has a missing dependency: 'message.content'. Either include it or remove the dependency array. If 'setEditedMessage' needs the current value of 'message.content', you can also switch to useReducer instead of useState and read 'message.content' in the reducer.  react-hooks/exhaustive-deps
15:22:50.052 |  
15:22:50.052 | ./components/setup/profile-step.tsx
15:22:50.052 | 49:37  Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.  react-hooks/exhaustive-deps
15:22:50.052 |  
15:22:50.052 | ./components/sidebar/items/all/sidebar-update-item.tsx
15:22:50.052 | 171:6  Warning: React Hook useEffect has missing dependencies: 'contentType', 'fetchDataFunctions', 'fetchSelectedWorkspaces', 'item.id', and 'workspaces.length'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.053 |  
15:22:50.053 | ./components/utility/announcements.tsx
15:22:50.053 | 53:6  Warning: React Hook useEffect has a missing dependency: 'announcements'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.053 |  
15:22:50.054 | ./components/utility/global-state.tsx
15:22:50.054 | 150:6  Warning: React Hook useEffect has a missing dependency: 'fetchStartingData'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.054 |  
15:22:50.054 | ./components/utility/profile-settings.tsx
15:22:50.054 | 241:37  Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.  react-hooks/exhaustive-deps
15:22:50.054 |  
15:22:50.054 | ./components/workspace/workspace-settings.tsx
15:22:50.055 | 76:6  Warning: React Hook useEffect has a missing dependency: 'selectedWorkspace?.image_path'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
15:22:50.055 |  
15:22:50.055 | info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
15:22:51.477 | Failed to compile.
15:22:51.477 |  
15:22:51.478 | ./app/[locale]/[workspaceid]/layout.tsx:97:19
15:22:51.478 | Type error: Argument of type '{}[]' is not assignable to parameter of type 'SetStateAction<never[]>'.
15:22:51.478 | Type '{}[]' is not assignable to type 'never[]'.
15:22:51.478 | Type '{}' is not assignable to type 'never'.
15:22:51.478 |  
15:22:51.478 | 95 \|
15:22:51.478 | 96 \|     const assistantData = await getAssistantWorkspacesByWorkspaceId(workspaceId)
15:22:51.478 | >  97 \|     setAssistants(assistantData.assistants)
15:22:51.478 | \|                   ^
15:22:51.478 | 98 \|
15:22:51.478 | 99 \|     for (const assistant of assistantData.assistants) {
15:22:51.478 | 100 \|       let url = ""
15:22:51.649 | Error: Command "npm run build" exited with 1

<!--EndFragment-->
</body>
</html>

Any help is appreciated

PrakrutR commented 8 months ago

I tried a fresh build with a new fork still the same error

<html>
<body>
<!--StartFragment-->

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
16:11:16.697 | Failed to compile.
16:11:16.697 |  
16:11:16.697 | ./app/[locale]/[workspaceid]/layout.tsx:97:19
16:11:16.697 | Type error: Argument of type '{}[]' is not assignable to parameter of type 'SetStateAction<never[]>'.
16:11:16.698 | Type '{}[]' is not assignable to type 'never[]'.
16:11:16.698 | Type '{}' is not assignable to type 'never'.
16:11:16.698 |  
16:11:16.698 | 95 \|
16:11:16.698 | 96 \|     const assistantData = await getAssistantWorkspacesByWorkspaceId(workspaceId)
16:11:16.698 | >  97 \|     setAssistants(assistantData.assistants)
16:11:16.698 | \|                   ^
16:11:16.698 | 98 \|
16:11:16.698 | 99 \|     for (const assistant of assistantData.assistants) {
16:11:16.698 | 100 \|       let url = ""
16:11:16.885 | Error: Command "npm run build" exited with 1
16:11:17.305

<br class="Apple-interchange-newline"><!--EndFragment-->
</body>
</html>

However I get no errors on the local build

wupengfei0904 commented 8 months ago

me too

PrakrutR commented 8 months ago

Still have the same problem even with a new deployment anyone any suggestion?

<html>
<body>
<!--StartFragment-->
Skipping build cache, deployment was triggered without cache.
--
12:16:50.085 | Cloning completed: 364.188ms
12:16:50.387 | Running "vercel build"
12:16:50.892 | Vercel CLI 33.2.0
12:16:51.650 | Installing dependencies...
12:16:57.780 | npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
12:16:58.138 | npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
12:16:58.756 | npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
12:17:01.537 | npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
12:17:02.344 | npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
12:17:36.760 |  
12:17:36.761 | > chatbot-ui@2.0.0 prepare
12:17:36.761 | > husky install
12:17:36.761 |  
12:17:36.829 | husky - Git hooks installed
12:17:36.851 |  
12:17:36.852 | added 1455 packages in 45s
12:17:36.852 |  
12:17:36.852 | 295 packages are looking for funding
12:17:36.853 | run `npm fund` for details
12:17:36.889 | Detected Next.js version: 14.1.0
12:17:36.902 | Detected `package-lock.json` generated by npm 7+
12:17:36.902 | Running "npm run build"
12:17:37.596 |  
12:17:37.596 | > chatbot-ui@2.0.0 build
12:17:37.597 | > next build
12:17:37.597 |  
12:17:38.705 | Attention: Next.js now collects completely anonymous telemetry regarding usage.
12:17:38.705 | This information is used to shape Next.js' roadmap and prioritize features.
12:17:38.705 | 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:
12:17:38.706 | https://nextjs.org/telemetry
12:17:38.706 |  
12:17:38.800 | ▲ Next.js 14.1.0
12:17:38.800 |  
12:17:38.874 | Creating an optimized production build ...
12:17:39.328 | > [PWA] Compile server
12:17:39.330 | > [PWA] Compile server
12:17:39.331 | > [PWA] Compile client (static)
12:17:39.331 | > [PWA] Custom worker found: /vercel/path0/worker/index.js
12:17:39.331 | > [PWA] Build custom worker: /vercel/path0/public/worker-WWChdCt5daL2n8v6MKi_5.js
12:17:39.441 | > [PWA] Auto register service worker with: /vercel/path0/node_modules/next-pwa/register.js
12:17:39.441 | > [PWA] Service worker: /vercel/path0/public/sw.js
12:17:39.441 | > [PWA]   url: /sw.js
12:17:39.442 | > [PWA]   scope: /
12:18:47.915 | ✓ Compiled successfully
12:18:47.916 | Linting and checking validity of types ...
12:19:05.892 |  
12:19:05.892 | ./app/[locale]/[workspaceid]/layout.tsx
12:19:05.892 | 71:6  Warning: React Hook useEffect has missing dependencies: 'fetchWorkspaceData', 'router', and 'workspaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.892 | 88:6  Warning: React Hook useEffect has missing dependencies: 'fetchWorkspaceData', 'setChatFiles', 'setChatImages', 'setChatMessages', 'setFirstTokenReceived', 'setIsGenerating', 'setNewMessageFiles', 'setNewMessageImages', 'setSelectedChat', 'setShowFilesDisplay', and 'setUserInput'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.892 |  
12:19:05.893 | ./app/[locale]/login/password/page.tsx
12:19:05.893 | 23:6  Warning: React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.893 |  
12:19:05.893 | ./app/[locale]/setup/page.tsx
12:19:05.893 | 99:6  Warning: React Hook useEffect has missing dependencies: 'router', 'setAvailableHostedModels', 'setAvailableOpenRouterModels', 'setEnvKeyMap', and 'setProfile'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.893 |  
12:19:05.893 | ./components/chat/chat-hooks/use-scroll.tsx
12:19:05.893 | 22:6  Warning: React Hook useEffect has a missing dependency: 'userScrolled'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.893 | 28:6  Warning: React Hook useEffect has missing dependencies: 'isGenerating', 'scrollToBottom', and 'userScrolled'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.893 |  
12:19:05.893 | ./components/chat/chat-hooks/use-select-file-handler.tsx
12:19:05.894 | 33:6  Warning: React Hook useEffect has a missing dependency: 'handleFilesToAccept'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.894 |  
12:19:05.894 | ./components/chat/chat-input.tsx
12:19:05.894 | 70:6  Warning: React Hook useEffect has a missing dependency: 'handleFocusChatInput'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.894 |  
12:19:05.894 | ./components/chat/chat-settings.tsx
12:19:05.894 | 40:6  Warning: React Hook useEffect has missing dependencies: 'chatSettings' and 'setChatSettings'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.894 |  
12:19:05.894 | ./components/chat/chat-ui.tsx
12:19:05.898 | 75:6  Warning: React Hook useEffect has missing dependencies: 'fetchChat', 'fetchMessages', 'handleFocusChatInput', 'params.chatid', 'scrollToBottom', and 'setIsAtBottom'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.898 |  
12:19:05.898 | ./components/messages/message-markdown.tsx
12:19:05.901 | 21:18  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
12:19:05.901 | 21:18  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
12:19:05.901 |  
12:19:05.901 | ./components/messages/message.tsx
12:19:05.901 | 128:6  Warning: React Hook useEffect has a missing dependency: 'message.content'. Either include it or remove the dependency array. If 'setEditedMessage' needs the current value of 'message.content', you can also switch to useReducer instead of useState and read 'message.content' in the reducer.  react-hooks/exhaustive-deps
12:19:05.901 |  
12:19:05.901 | ./components/setup/profile-step.tsx
12:19:05.901 | 49:37  Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.  react-hooks/exhaustive-deps
12:19:05.902 |  
12:19:05.902 | ./components/sidebar/items/all/sidebar-update-item.tsx
12:19:05.902 | 171:6  Warning: React Hook useEffect has missing dependencies: 'contentType', 'fetchDataFunctions', 'fetchSelectedWorkspaces', 'item.id', and 'workspaces.length'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.902 |  
12:19:05.902 | ./components/utility/announcements.tsx
12:19:05.902 | 53:6  Warning: React Hook useEffect has a missing dependency: 'announcements'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.902 |  
12:19:05.902 | ./components/utility/global-state.tsx
12:19:05.902 | 150:6  Warning: React Hook useEffect has a missing dependency: 'fetchStartingData'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.902 |  
12:19:05.902 | ./components/utility/profile-settings.tsx
12:19:05.902 | 241:37  Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.  react-hooks/exhaustive-deps
12:19:05.903 |  
12:19:05.903 | ./components/workspace/workspace-settings.tsx
12:19:05.903 | 76:6  Warning: React Hook useEffect has a missing dependency: 'selectedWorkspace?.image_path'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
12:19:05.903 |  
12:19:05.903 | info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
12:19:08.636 | Failed to compile.
12:19:08.638 |  
12:19:08.638 | ./app/[locale]/[workspaceid]/layout.tsx:97:19
12:19:08.638 | Type error: Argument of type '{}[]' is not assignable to parameter of type 'SetStateAction<never[]>'.
12:19:08.640 |  
12:19:08.641 | 95 \|
12:19:08.641 | 96 \|     const assistantData = await getAssistantWorkspacesByWorkspaceId(workspaceId)
12:19:08.641 | >  97 \|     setAssistants(assistantData.assistants)
12:19:08.641 | \|                   ^
12:19:08.641 | 98 \|
12:19:08.641 | 99 \|     for (const assistant of assistantData.assistants) {
12:19:08.641 | 100 \|       let url = ""
12:19:08.847 | Error: Command "npm run build" exited with 1

<!--EndFragment-->
</body>
</html>
PrakrutR commented 8 months ago

@mckaywrigley I am still having the issue could you please tell me what the fix is exactly?

PrakrutR commented 8 months ago

Nevermind running

npm run update
npm db-push

and then recreating the deployment fixes this TYSM!