Skip to content

Commit 47fe343

Browse files
committed
chore: add comment to the chat.ts file, that explains why do we have this file
1 parent c5cd8a6 commit 47fe343

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

custom/chat.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/**
2+
* This file is used to fix circular module initialization between ai and @ai-sdk/vue
3+
* These files are depending on each other, but vite put them in different chunks, so they are not initialized at the same time, which causes the circular module initialization issue
4+
* So I get rid of the @ai-sdk/vue only fixes are:
5+
* 1) Change vite config to put these files in the same chunk
6+
* 2) Get rid of the circular module initialization by moving the Chat class to this file
7+
*
8+
* Maybe there is a better way to fix this issue
9+
*
10+
* If you were updating "ai" package and plugin broke, probably you need to update this file as well
11+
* Or resolve the circular module initialization issue in a better way
12+
*/
13+
114
import {
215
AbstractChat,
316
ChatInit as BaseChatInit,

0 commit comments

Comments
 (0)