Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank screen on /chat and /with-terms-and-retrieval #2

Open
janacm opened this issue Nov 19, 2024 · 6 comments
Open

Blank screen on /chat and /with-terms-and-retrieval #2

janacm opened this issue Nov 19, 2024 · 6 comments

Comments

@janacm
Copy link

janacm commented Nov 19, 2024

Seeing blank screens on /chat and /chat/with-terms-and-retrieval.

image

Seeing hydration errors in console:

image
chunk-ZQTY7F4A.js?v=551b39ef:9491 Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.
    at throwOnHydrationMismatch (chunk-ZQTY7F4A.js?v=551b39ef:9491:17)
    at tryToClaimNextHydratableInstance (chunk-ZQTY7F4A.js?v=551b39ef:9512:15)
    at updateHostComponent (chunk-ZQTY7F4A.js?v=551b39ef:14789:13)
    at beginWork (chunk-ZQTY7F4A.js?v=551b39ef:15923:22)
    at beginWork$1 (chunk-ZQTY7F4A.js?v=551b39ef:19749:22)
    at performUnitOfWork (chunk-ZQTY7F4A.js?v=551b39ef:19194:20)
    at workLoopConcurrent (chunk-ZQTY7F4A.js?v=551b39ef:19185:13)
    at renderRootConcurrent (chunk-ZQTY7F4A.js?v=551b39ef:19160:15)
    at performConcurrentWorkOnRoot (chunk-ZQTY7F4A.js?v=551b39ef:18674:46)
    at workLoop (chunk-ZQTY7F4A.js?v=551b39ef:197:42)

chunk-ZQTY7F4A.js?v=551b39ef:14755 Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
    at updateHostRoot (chunk-ZQTY7F4A.js?v=551b39ef:14755:65)
    at beginWork (chunk-ZQTY7F4A.js?v=551b39ef:15921:22)
    at beginWork$1 (chunk-ZQTY7F4A.js?v=551b39ef:19749:22)
    at performUnitOfWork (chunk-ZQTY7F4A.js?v=551b39ef:19194:20)
    at workLoopSync (chunk-ZQTY7F4A.js?v=551b39ef:19133:13)
    at renderRootSync (chunk-ZQTY7F4A.js?v=551b39ef:19112:15)
    at recoverFromConcurrentError (chunk-ZQTY7F4A.js?v=551b39ef:18732:28)
    at performConcurrentWorkOnRoot (chunk-ZQTY7F4A.js?v=551b39ef:18680:30)
    at workLoop (chunk-ZQTY7F4A.js?v=551b39ef:197:42)
    at flushWork (chunk-ZQTY7F4A.js?v=551b39ef:176:22)
@dwcarr
Copy link
Contributor

dwcarr commented Nov 20, 2024

Cannot reproduce. Must be a semver issue or something. I will try rolling the remix version forward and see if I can run into this.

@dwcarr
Copy link
Contributor

dwcarr commented Nov 20, 2024

Ok, the blank screen issue was a css problem, it only showed up on XL screens.

I still can't produce any hydration issues, though. Those wouldn't stop it from functioning, usually, anyway.

@janacm
Copy link
Author

janacm commented Nov 20, 2024

Ok, chat shows up now, but still unusable:

image

Getting an error after submitting the first prompt into the chat:

TypeError: Cannot read properties of null (reading 'length')
    at new AIMessage (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/core/dist/messages/ai.js:33:30)
    at openAIResponseToChatMessage (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/openai/dist/chat_models.js:61:20)
    at ChatDeepInfra._generate (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/openai/dist/chat_models.js:637:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.allSettled (index 0)
    at async ChatDeepInfra._generateUncached (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/core/dist/language_models/chat_models.js:114:25)
    at async ChatDeepInfra.invoke (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/core/dist/language_models/chat_models.js:50:24)
    at async RunnableSequence.invoke (file:///C:/Users/janac/Documents/GitHub/remix-simple-chat/node_modules/@langchain/core/dist/runnables/base.js:1055:33)
    at async chatAction (C:\Users\janac\Documents\GitHub\remix-simple-chat\app\routes\chat+\actions\chatAction.ts:68:20)

Looks like there's still some langchain remnants

@dwcarr
Copy link
Contributor

dwcarr commented Nov 21, 2024

ok. I will rip that out.
In the meantime, If you go into the package.json and take out the ^ on all of the langchain versions, followed by an npm i, then it might work. You might want to delete your node_modules before the npm i.

There may be other version conflicts still, but it's worth a try. Langchain is the worst in this regard. I will never look at them again until I at least see a version number that starts with >1.0.

@dwcarr
Copy link
Contributor

dwcarr commented Nov 21, 2024

Ok, I just pushed a version without langchain. Tests fine for me. (note that locally, it will sometimes have an error the first time it comes up, just refresh. I see that a lot, but deployed versions never has a problem).

I did not fix the portalChatAction and portalChatLoader yet, but the /chat and /chat/with-terms-and-retrieval routes are fully functional, sans langchain.

@dwcarr
Copy link
Contributor

dwcarr commented Nov 21, 2024

portalChatAction and portalChatLoader have now been updated.

Please test it out, and close the issue if things are looking good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants