lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.4k stars 9.95k forks source link

[Bug] Clerk integration is broken #3516

Closed waclawthedev closed 2 months ago

waclawthedev commented 2 months ago

📦 Environment

Docker

📌 Version

v1.11.8

💻 Operating System

macOS

🌐 Browser

Chrome

🐛 Bug Description

After tying to visit http://localhost:3210/ I see Application error: a client-side exception has occurred (see the browser console for more information). In chrome console:

layout-55d8206e8f530a3d.js:1 Uncaught (in promise) 
Error: Cannot find module './en-us.js'
    at layout-55d8206e8f530a3d.js:1:15536
    at async layout-55d8206e8f530a3d.js:1:33151
59128-57db5d32a47acd7f.js:1 
Error: @clerk/nextjs: Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.
    at Object.throwMissingPublishableKeyError (27631-6d4d762f9b5319cd.js:1:44405)
    at 27631-6d4d762f9b5319cd.js:1:37040
    at rE (03a983a9-e6edb4c715482cd6.js:1:40343)
    at iZ (03a983a9-e6edb4c715482cd6.js:1:117028)
    at ia (03a983a9-e6edb4c715482cd6.js:1:95164)
    at 03a983a9-e6edb4c715482cd6.js:1:94986
    at il (03a983a9-e6edb4c715482cd6.js:1:94993)
    at oJ (03a983a9-e6edb4c715482cd6.js:1:92349)
    at oZ (03a983a9-e6edb4c715482cd6.js:1:91768)
    at MessagePort.M (59128-57db5d32a47acd7f.js:1:92034)
03a983a9-e6edb4c715482cd6.js:1 Uncaught 
Error: Minified React error #423; visit https://react.dev/errors/423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at iZ (03a983a9-e6edb4c715482cd6.js:1:118351)
    at ia (03a983a9-e6edb4c715482cd6.js:1:95164)
    at 03a983a9-e6edb4c715482cd6.js:1:94986
    at il (03a983a9-e6edb4c715482cd6.js:1:94993)
    at oJ (03a983a9-e6edb4c715482cd6.js:1:92349)
    at oZ (03a983a9-e6edb4c715482cd6.js:1:91768)
    at MessagePort.M (59128-57db5d32a47acd7f.js:1:92034)

My docker compose config:

  chat:
    image: lobehub/lobe-chat:v1.11.8
    container_name: lobe-chat
    restart: always
    ports:
      - '3210:3210'
    environment:
      ACCESS_CODE: lobe66
      NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: pk_live_***
      CLERK_SECRET_KEY: sk_live_***

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 2 months ago

👀 @waclawthedev

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

arvinxx commented 2 months ago

Docker can't use clerk due to the NEXT_PUBLIC env. https://github.com/lobehub/lobe-chat/discussions/2947#discussioncomment-9824765

lobehubbot commented 2 months ago

✅ @waclawthedev

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。

waclawthedev commented 2 months ago

@arvinxx so, I am right that docs are not complete? https://lobehub.com/docs/self-hosting/advanced/auth says I need only NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY be set. Did I miss something?

Lodimup commented 2 months ago

NEXTPUBLIC needs to be available at build time so you'd need to build the image yourself

ipruthi commented 3 weeks ago

@arvinxx and @Lodimup - I installed via RepoCloud and I'm running into the same issue as @waclawthedev.

If the env variables are not available for One-Click installations for the providers listed in your Docs, then this should be noted. I'll work on a pull request for this. Thanks!