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.6k stars 7.96k forks source link

npm run build fails to compile #1551

Closed castortech closed 7 months ago

castortech commented 7 months ago

I am trying to build and getting a bunch of warning, but also an error in code that was just recently changed

chatbot-ui@2.0.0 build next build

▲ Next.js 14.1.0

./app/[locale]/[workspaceid]/layout.tsx 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 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

./app/[locale]/login/password/page.tsx 23:6 Warning: React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./app/[locale]/setup/page.tsx 100: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

./components/chat/chat-hooks/use-scroll.tsx 29:6 Warning: React Hook useEffect has a missing dependency: 'userScrolled'. Either include it or remove the dependency array. react-hooks/exhaustive-deps 35:6 Warning: React Hook useEffect has missing dependencies: 'isGenerating', 'scrollToBottom', and 'userScrolled'. Either include them or remove the dependency array. react-hooks/exhaustive-deps

./components/chat/chat-hooks/use-select-file-handler.tsx 33:6 Warning: React Hook useEffect has a missing dependency: 'handleFilesToAccept'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./components/chat/chat-input.tsx 82:6 Warning: React Hook useEffect has a missing dependency: 'handleFocusChatInput'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./components/chat/chat-settings.tsx 47:6 Warning: React Hook useEffect has missing dependencies: 'chatSettings' and 'setChatSettings'. Either include them or remove the dependency array. react-hooks/exhaustive-deps

./components/chat/chat-ui.tsx 77: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

./components/messages/message-markdown.tsx 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 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

./components/messages/message.tsx 127: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

./components/setup/profile-step.tsx 49:37 Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead. react-hooks/exhaustive-deps

./components/sidebar/items/all/sidebar-update-item.tsx 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

./components/utility/announcements.tsx 53:6 Warning: React Hook useEffect has a missing dependency: 'announcements'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./components/utility/global-state.tsx 153:6 Warning: React Hook useEffect has a missing dependency: 'fetchStartingData'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./components/utility/profile-settings.tsx 244:37 Warning: React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead. react-hooks/exhaustive-deps

./components/workspace/workspace-settings.tsx 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

info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules Linting and checking validity of types ...Failed to compile.

./app/api/chat/anthropic/route.ts:27:38 Type error: Property 'messages' does not exist on type 'Anthropic'.

25 | }) 26 |

27 | const response = await anthropic.messages.create({ | ^ 28 | model: chatSettings.model, 29 | messages: ANTHROPIC_FORMATTED_MESSAGES, 30 | temperature: chatSettings.temperature,

castortech commented 7 months ago

Environment was out of sync.