astro-chat
astro-chat copied to clipboard
Error "Event not defined" in listen function of index.astro
When running the project, I encountered the following error logged in the console: "Uncaught (in promise) Error: Event not defined at listen (index.astro:95:17)". Upon further investigation, I found that the issue is related to the listen function in the index.astro file. However I am not sure how to fix it
https://github.com/pilcrowOnPaper/astro-chat/blob/1196fcbe945732828c0f20f169efdc95118b3f1b/src/pages/index.astro#L87-L96
I can't explain about detailed, splitted chunk contain '' empty string at first item. so after filtering, you can see it working.
const lines = chunk.split("\n").filter(line => line !== '');