Find answers from the community

Updated 3 months ago

Hey everyone, trying this message here

Hey everyone, trying this message here in case someone knows a solution. Thanks in advance.

I'm getting this weird parsing error from the node-parser module. peg$SyntaxError: Expected "http://", "https://", [([{"'β€˜], [0-9], [^ \t\n\r!?([}")\]}"0-9@], [^ \t\n\r!?.([})]}"0-9@], [a-z0-9], or [a-z] but "\n" found.
I'm using a markdown file and this error is saying that the "\n" character is invalid? even though it clearly says it's an accepted value. Has anyone else seen this??
L
j
3 comments
What is the code you are using that is causing this error?
Plain Text
const directoryPath = "./data";
const directoryReader = new SimpleDirectoryReader();
const documents = await directoryReader.loadData({ directoryPath });
const storageContext = await storageContextFromDefaults({
  persistDir: "./cache/storage",
});
indexStore = await VectorStoreIndex.fromDocuments([document], {
   storageContext,
});
This is just reading in the files, loading the data, creating and persisting a storage context, then instantiating the store. Works in the AWS server, but not locally. Other file types work though, it's just markdown that fail locally for some reason. I've tried deleting and reinstalling node packages. Still nothing works.
Add a reply
Sign up and join the conversation on Discord