Edit:
Ok. I haven't been able to reproduce this issue (I know "it worked on my machine" is the worst answer. But I did do a fresh setup on two other machines to see if I can recreate so it worked on three of my machines?).
If you want to drop me an email (my email is in my profile), I'm happy to help find time to debug live and I'd personally love to find out what the issue is. And/or hook you up with a t-shirt :)
Digging in, this specific error looks like it is happening when LangChain is trying to strip out new lines (you can see the code in LangChain here: https://github.com/hwchase17/langchainjs/blob/main/langchain...). For some reason your documents or embeddings are undefined. But I've been unable to create a scenario where that happens.
I wondered if perhaps your OpenAI API Key wasn't set correctly and it was causing the Embeddings to fail, but I tried both deleting my key and setting to bogus key and the error was different.
Any chance you switched out the URL we were pulling from? That didn't cause the same error for me either, but thinking through what else it could be.
Sorry to not resolve, but please feel free to drop me an email. I'll keep trying to reproduce as well, and will jump back in this comment if I do (and find a fix).