coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
4.32k stars 1.77k forks source link

Error: The symbol "provider" has already been declared #239

Closed Corwin006 closed 1 week ago

Corwin006 commented 2 weeks ago

Describe the bug

There is an Error in the latest version.

20:34:26 [vite] Internal server error: Transform failed with 2 errors: F:/AI/AI_Dev/bolt.new-any-llm/app/components/chat/BaseChat.tsx:116:10: ERROR: The symbol "provider" has already been declared F:/AI/AI_Dev/bolt.new-any-llm/app/components/chat/BaseChat.tsx:116:10: ERROR: The symbol "setProvider" has already been declared Plugin: vite:esbuild File: F:/AI/AI_Dev/bolt.new-any-llm/app/components/chat/BaseChat.tsx:116:10

The symbol "provider" has already been declared 114| ) => { 115| const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200; 116| const [provider, setProvider] = useState(DEFAULT_PROVIDER); | ^ 117| const [apiKeys, setApiKeys] = useState<Record<string, string>>({}); 118|

The symbol "setProvider" has already been declared 114| ) => { 115| const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200; 116| const [provider, setProvider] = useState(DEFAULT_PROVIDER); | ^ 117| const [apiKeys, setApiKeys] = useState<Record<string, string>>({}); 118|

Link to the Bolt URL that caused the error

http://localhost:5173/

Steps to reproduce

Maybe caused by this commit: SHA-1: 936a9c0f69db47b35165cf6a807fd5771f82ea8c

fix: respect provider choice from UI

Expected behavior

shouldn't display this error.

Screen Recording / Screenshot

image

Platform

Additional context

No response

chrismahoney commented 1 week ago

Can you ensure you're on latest main branch and try this again? There is currently just one reference to instantiating provider/setProvider via useState on line 28 of BaseChat.

Corwin006 commented 1 week ago

Can you ensure you're on latest main branch and try this again? There is currently just one reference to instantiating provider/setProvider via useState on line 28 of BaseChat.

Thank you very much. After pulling the latest branch, the problem is resolved!