astro-chat icon indicating copy to clipboard operation
astro-chat copied to clipboard

Error "Event not defined" in listen function of index.astro

Open bkyerv opened this issue 2 years ago • 1 comments

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

bkyerv avatar Dec 20 '23 05:12 bkyerv

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 !== '');

imjlk avatar Dec 28 '23 04:12 imjlk