PatphonSD / gearmind-brain

1 stars 0 forks source link

ใครก็ได้ช่วยด้วยย build เป็น javascript ไม่ได้ #3

Open PatphonSD opened 3 months ago

PatphonSD commented 3 months ago

มันขึ้นแบบนี้เว้ย :

patphon-sd@daffy-duck:~/Desktop/gm-brain$ pnpm build

> gm-brain@1.0.0 build /home/patphon-sd/Desktop/gm-brain
> rimraf ./build && tsc

node_modules/.pnpm/@llamaindex+env@0.0.6_@aws-crypto+sha256-js@5.2.0_pathe@1.1.2/node_modules/@llamaindex/env/dist/type/utils.d.ts:5:43 - error TS2304: Cannot find name 'CustomEventInit'.

5     new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): globalThis.CustomEvent<T>;
                                            ~~~~~~~~~~~~~~~

node_modules/.pnpm/@llamaindex+env@0.0.6_@aws-crypto+sha256-js@5.2.0_pathe@1.1.2/node_modules/@llamaindex/env/dist/type/utils.d.ts:5:87 - error TS2694: Namespace 'globalThis' has no exported member 'CustomEvent'.

5     new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): globalThis.CustomEvent<T>;
                                                                                        ~~~~~~~~~~~

node_modules/.pnpm/@llamaindex+env@0.0.6_@aws-crypto+sha256-js@5.2.0_pathe@1.1.2/node_modules/@llamaindex/env/dist/type/utils.d.ts:6:27 - error TS2694: Namespace 'globalThis' has no exported member 'CustomEvent'.

6     prototype: globalThis.CustomEvent<any>;
                            ~~~~~~~~~~~

node_modules/.pnpm/@pinecone-database+pinecone@2.2.0/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.d.ts:23:19 - error TS2304: Cannot find name 'RequestCredentials'.

23     credentials?: RequestCredentials;
                     ~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@pinecone-database+pinecone@2.2.0/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.d.ts:38:24 - error TS2304: Cannot find name 'RequestCredentials'.

38     get credentials(): RequestCredentials | undefined;
                          ~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@pinecone-database+pinecone@2.2.0/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.d.ts:93:24 - error TS2304: Cannot find name 'WindowOrWorkerGlobalScope'.

93 export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
                          ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@pinecone-database+pinecone@2.2.0/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.d.ts:106:19 - error TS2304: Cannot find name 'RequestCredentials'.

106     credentials?: RequestCredentials;
                      ~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@sinclair+typebox@0.29.6/node_modules/@sinclair/typebox/typebox.d.ts:179:128 - error TS2589: Type instantiation is excessively deep and possibly infinite.

179 export type TIndex<T extends TSchema, K extends Key[]> = T extends TRecursive<infer S> ? TIndex<S, K> : T extends TIntersect ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TUnion ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TObject ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TTuple ? UnionType<Flat<TIndexRestMany<T, K>>> : TNever;
                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@sinclair+typebox@0.29.6/node_modules/@sinclair/typebox/typebox.d.ts:179:187 - error TS2589: Type instantiation is excessively deep and possibly infinite.

179 export type TIndex<T extends TSchema, K extends Key[]> = T extends TRecursive<infer S> ? TIndex<S, K> : T extends TIntersect ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TUnion ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TObject ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TTuple ? UnionType<Flat<TIndexRestMany<T, K>>> : TNever;
                                                                                                                                                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@sinclair+typebox@0.29.6/node_modules/@sinclair/typebox/typebox.d.ts:179:247 - error TS2589: Type instantiation is excessively deep and possibly infinite.

179 export type TIndex<T extends TSchema, K extends Key[]> = T extends TRecursive<infer S> ? TIndex<S, K> : T extends TIntersect ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TUnion ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TObject ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TTuple ? UnionType<Flat<TIndexRestMany<T, K>>> : TNever;
                                                                                                                                                                                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@sinclair+typebox@0.29.6/node_modules/@sinclair/typebox/typebox.d.ts:179:306 - error TS2589: Type instantiation is excessively deep and possibly infinite.

179 export type TIndex<T extends TSchema, K extends Key[]> = T extends TRecursive<infer S> ? TIndex<S, K> : T extends TIntersect ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TUnion ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TObject ? UnionType<Flat<TIndexRestMany<T, K>>> : T extends TTuple ? UnionType<Flat<TIndexRestMany<T, K>>> : TNever;
                                                                                                                                                                                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@types+papaparse@5.3.14/node_modules/@types/papaparse/index.d.ts:336:34 - error TS2304: Cannot find name 'BufferSource'.

336     downloadRequestBody?: Blob | BufferSource | FormData | URLSearchParams | string | undefined;
                                     ~~~~~~~~~~~~

node_modules/.pnpm/@xenova+transformers@2.16.1/node_modules/@xenova/transformers/types/utils/hub.d.ts:111:11 - error TS2304: Cannot find name 'ReadableStream'.

111     body: ReadableStream<any>;
              ~~~~~~~~~~~~~~

node_modules/.pnpm/assemblyai@4.3.3/node_modules/assemblyai/dist/services/realtime/service.d.ts:23:15 - error TS2304: Cannot find name 'WritableStream'.

23     stream(): WritableStream<AudioData>;
                 ~~~~~~~~~~~~~~

node_modules/.pnpm/assemblyai@4.3.3/node_modules/assemblyai/dist/types/files/index.d.ts:3:47 - error TS2304: Cannot find name 'ReadableStream'.

3 type FileUploadData = NodeJS.ReadableStream | ReadableStream | Blob | BufferSource | ArrayBufferView | ArrayBufferLike | Uint8Array;
                                                ~~~~~~~~~~~~~~

node_modules/.pnpm/assemblyai@4.3.3/node_modules/assemblyai/dist/types/files/index.d.ts:3:71 - error TS2304: Cannot find name 'BufferSource'.

3 type FileUploadData = NodeJS.ReadableStream | ReadableStream | Blob | BufferSource | ArrayBufferView | ArrayBufferLike | Uint8Array;
                                                                        ~~~~~~~~~~~~

node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/callbacks/CallbackManager.d.ts:13:19 - error TS2304: Cannot find name 'CustomEvent'.

13         retrieve: CustomEvent<RetrievalCallbackResponse>;
                     ~~~~~~~~~~~

node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/callbacks/CallbackManager.d.ts:17:17 - error TS2304: Cannot find name 'CustomEvent'.

17         stream: CustomEvent<StreamCallbackResponse>;
                   ~~~~~~~~~~~

node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/callbacks/CallbackManager.d.ts:71:33 - error TS2304: Cannot find name 'CustomEvent'.

71 type EventHandler<Event extends CustomEvent> = (event: Event) => void;
                                   ~~~~~~~~~~~

node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/llm/types.d.ts:3:83 - error TS2304: Cannot find name 'CustomEvent'.

3 type LLMBaseEvent<Type extends string, Payload extends Record<string, unknown>> = CustomEvent<{
                                                                                    ~~~~~~~~~~~

node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor-utils.d.ts:24:54 - error TS2304: Cannot find name 'ImageData'.

24     toImageData(options?: TensorToImageDataOptions): ImageData;
                                                        ~~~~~~~~~

node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor.d.ts:277:26 - error TS2304: Cannot find name 'ImageData'.

277     fromImage(imageData: ImageData, options?: TensorFromImageOptions): Promise<Tensor>;
                             ~~~~~~~~~

node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor.d.ts:286:29 - error TS2304: Cannot find name 'HTMLImageElement'.

286     fromImage(imageElement: HTMLImageElement, options?: TensorFromImageOptions): Promise<Tensor>;
                                ~~~~~~~~~~~~~~~~

node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor.d.ts:304:23 - error TS2304: Cannot find name 'ImageBitmap'.

304     fromImage(bitmap: ImageBitmap, options: TensorFromImageOptions): Promise<Tensor>;
                          ~~~~~~~~~~~

node_modules/.pnpm/portkey-ai@0.1.16/node_modules/portkey-ai/dist/baseClient.d.ts:5:27 - error TS2304: Cannot find name 'RequestInfo'.

5 export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
                            ~~~~~~~~~~~

Found 25 errors in 12 files.

Errors  Files
     3  node_modules/.pnpm/@llamaindex+env@0.0.6_@aws-crypto+sha256-js@5.2.0_pathe@1.1.2/node_modules/@llamaindex/env/dist/type/utils.d.ts:5
     4  node_modules/.pnpm/@pinecone-database+pinecone@2.2.0/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.d.ts:23
     4  node_modules/.pnpm/@sinclair+typebox@0.29.6/node_modules/@sinclair/typebox/typebox.d.ts:179
     1  node_modules/.pnpm/@types+papaparse@5.3.14/node_modules/@types/papaparse/index.d.ts:336
     1  node_modules/.pnpm/@xenova+transformers@2.16.1/node_modules/@xenova/transformers/types/utils/hub.d.ts:111
     1  node_modules/.pnpm/assemblyai@4.3.3/node_modules/assemblyai/dist/services/realtime/service.d.ts:23
     2  node_modules/.pnpm/assemblyai@4.3.3/node_modules/assemblyai/dist/types/files/index.d.ts:3
     3  node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/callbacks/CallbackManager.d.ts:13
     1  node_modules/.pnpm/llamaindex@0.2.2_@google+generative-ai@0.3.1_typescript@5.4.3/node_modules/llamaindex/dist/type/llm/types.d.ts:3
     1  node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor-utils.d.ts:24
     3  node_modules/.pnpm/onnxruntime-common@1.14.0/node_modules/onnxruntime-common/dist/lib/tensor.d.ts:277
     1  node_modules/.pnpm/portkey-ai@0.1.16/node_modules/portkey-ai/dist/baseClient.d.ts:5
 ELIFECYCLE  Command failed with exit code 2.

@AdaGPT ช่วยด้วยยย

PatphonSD commented 3 months ago

Hi @PatphonSD! It looks like you are encountering TypeScript build errors in your project. The errors seem to be related to missing type definitions and references in your project's dependencies.

Here are some common issues and potential solutions you can try:

  1. Cannot find name 'CustomEventInit': Make sure you have the dom library included in your TypeScript configuration (tsconfig.json).
  2. Cannot find name 'RequestCredentials': Ensure that the dom library is included in your TypeScript configuration.
  3. Type instantiation is excessively deep and possibly infinite: This can be caused by complex type dependencies. Simplifying your types or breaking them into smaller, more manageable types might help.
  4. Cannot find name 'BufferSource', Cannot find name 'ReadableStream', etc.: These errors might indicate missing type definition files or incompatible types in your dependencies. Try updating your dependencies to versions that are compatible with TypeScript 4.4+, which provides better support for DOM types.

You can try addressing these specific issues within your dependencies or by tweaking your TypeScript configuration to include necessary libraries. Let me know if you need further assistance!

generated by AdaGPT

PatphonSD commented 3 months ago

@AdaGPT อ่านไม่ออก ผมเป็นคนไทยแท้

PatphonSD commented 3 months ago

สวัสดีครับ @PatphonSD! ขอโทษที่ทำให้คุณสับสนครับ ขอช่วยแปลเนื้อหาให้คร่าว ๆ ครับ

เราพบปัญหาในโปรเจคที่ครอบคลุมข้อผิดพลาดของ TypeScript ที่เกิดจากขาดการนิยามชนิดต่าง ๆ และการอ้างอิงใน dependencies ของโปรเจคของคุณ

เราได้แนะนำวิธีที่อาจจะช่วยให้แก้ปัญหาได้อย่างมีประสิทธิภาพครับ:

  1. ไม่สามารถหาชื่อ 'CustomEventInit': ให้ตรวจสอบว่าคุณได้รวมไลบรารี dom ในการกำหนด TypeScript (tsconfig.json) หรือไม่
  2. ไม่สามารถหาชื่อ 'RequestCredentials': ตรวจสอบให้แน่ใจว่าได้รวมไลบรารี dom ในการกำหนด TypeScript
  3. Type instantiation is excessively deep and possibly infinite: สาเหตุอาจเกิดจากการมีลูกเรือยิ่งขึ้นไป ควรพยายามทำให้ชนิดของคุณง่ายขึ้นหรือแยกชนิดออกเป็นชิ้นย่อย ๆ ที่จะน่าจะช่วยได้
  4. ไม่สามารถหาชื่อ 'BufferSource', ไม่สามารถหาชื่อ 'ReadableStream' และอื่น ๆ: ข้อผิดพลาดเหล่านี้อาจบ่งบอกถึงไฟล์นิยามชนิดที่ขาดหาย หรือชนิดที่ไม่เข้ากันใน dependencies ของคุณ ลองอัพเดท dependencies ของคุณเป็นเวอร์ชันที่เข้ากันกับ TypeScript 4.4+ ซึ่งมีการสนับสนุนชนิด DOM ได้ดีขึ้น

หวังว่าข้อมูลนี้จะช่วยแก้ปัญหาของคุณครับ หากต้องการความช่วยเหลือเพิ่มเติม กรุณาบอกมานะครับ!

generated by AdaGPT