Skip to content

Elysia Build Error With Node From Docs #1260

Open
@pedroota

Description

@pedroota

What version of Elysia is running?

1.3.5

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

Following the quick start guide on the ElysiaJS documentation, building the project using pnpm build results in errors when using the Node adapter:

`
pnpm build

test2@1.0.0 build /Users/pedrootavio/Developer/www/test2
tsc src/index.ts --outDir dist

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:3:78 - error TS2307: Cannot find module 'elysia/universal/server' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/universal/server.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

3 listen(app: import("elysia").AnyElysia): (options: any, callback: import("elysia/universal/server").ListenCallback | undefined) => void;
~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:9:61 - error TS2307: Cannot find module 'elysia/types' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/types.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

9 createStaticHandler?(handle: unknown, hooks: import("elysia/types").AnyLocalHook, setHeaders?: import("elysia").Context["set"]["headers"], ...params: unknown[]): (() => unknown) | undefined;
~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:10:67 - error TS2307: Cannot find module 'elysia/types' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/types.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

10 createNativeStaticHandler?(handle: unknown, hooks: import("elysia/types").AnyLocalHook, setHeaders?: import("elysia").Context["set"]["headers"], ...params: unknown[]): (() => import("elysia").MaybePromise) | undefined;
~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:14:36 - error TS2307: Cannot find module 'elysia/sucrose' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/sucrose.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

14 declare?(inference: import("elysia/sucrose").Sucrose.Inference): string | undefined;
~~~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:18:24 - error TS2307: Cannot find module 'elysia/types' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/types.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

18 parser: import("elysia/types").Prettify<Record<"json" | "text" | "urlencoded" | "arrayBuffer" | "formData", (isOptional: boolean) => string> & {
~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:38:72 - error TS2307: Cannot find module 'elysia/ws/types' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/ws/types.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

38 ws?(app: import("elysia").AnyElysia, path: string, handler: import("elysia/ws/types").AnyWSLocalHook): unknown;
~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:39:75 - error TS2307: Cannot find module 'elysia/types' or its corresponding type declarations.
There are types at '/Users/pedrootavio/Developer/www/test2/node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21._coosbemy2n2eblydxf7eqwjpee/node_modules/elysia/dist/types.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

39 createSystemRouterHandler?(method: string, path: string, hook: import("elysia/types").AnyLocalHook, app: import("elysia").AnyElysia): void;
~~~~~~~~~~~~~~

node_modules/.pnpm/@sinclair+typebox@0.34.35/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

6 #private;
~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:35:293 - error TS2536: Type '{ readonly Continue: 100; readonly 'Switching Protocols': 101; readonly Processing: 102; readonly 'Early Hints': 103; readonly OK: 200; readonly Created: 201; readonly Accepted: 202; readonly 'Non-Authoritative Information': 203; ... 51 more ...; readonly 'Network Authentication Required': 511; }[Code]' cannot be used to index type 'Route["response"]'.

35 status: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:35:392 - error TS2344: Type 'Code' does not satisfy the constraint 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"] | { readonly 100: "Continue"; readonly 101: "Switching Protocols"; readonly 102: "Processing"; readonly 103: "Early Hints"; readonly 200: "OK"; readonly 201: "Created"; ... 53 more ...; readonly 511: "Network Authentication Required"; }[Extract<...> | ... 58 more ... | Extract<...>]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string | number | symbol' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.

35 status: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:110:293 - error TS2536: Type '{ readonly Continue: 100; readonly 'Switching Protocols': 101; readonly Processing: 102; readonly 'Early Hints': 103; readonly OK: 200; readonly Created: 201; readonly Accepted: 202; readonly 'Non-Authoritative Information': 203; ... 51 more ...; readonly 'Network Authentication Required': 511; }[Code]' cannot be used to index type 'Route["response"]'.

110 status: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:110:392 - error TS2344: Type 'Code' does not satisfy the constraint 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"] | { readonly 100: "Continue"; readonly 101: "Switching Protocols"; readonly 102: "Processing"; readonly 103: "Early Hints"; readonly 200: "OK"; readonly 201: "Created"; ... 53 more ...; readonly 511: "Network Authentication Required"; }[Extract<...> | ... 58 more ... | Extract<...>]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string | number | symbol' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.

110 status: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:114:292 - error TS2536: Type '{ readonly Continue: 100; readonly 'Switching Protocols': 101; readonly Processing: 102; readonly 'Early Hints': 103; readonly OK: 200; readonly Created: 201; readonly Accepted: 202; readonly 'Non-Authoritative Information': 203; ... 51 more ...; readonly 'Network Authentication Required': 511; }[Code]' cannot be used to index type 'Route["response"]'.

114 error: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:114:391 - error TS2344: Type 'Code' does not satisfy the constraint 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"] | { readonly 100: "Continue"; readonly 101: "Switching Protocols"; readonly 102: "Processing"; readonly 103: "Early Hints"; readonly 200: "OK"; readonly 201: "Created"; ... 53 more ...; readonly 511: "Network Authentication Required"; }[Extract<...> | ... 58 more ... | Extract<...>]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route["response"]' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string | number | symbol' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.

114 error: {} extends Route['response'] ? typeof status : <const Code extends keyof Route['response'] | InvertedStatusMap[Extract<InvertedStatusMapKey, keyof Route['response']>], const T extends Code extends keyof Route['response'] ? Route['response'][Code] : Code extends keyof StatusMap ? Route['response'][StatusMap[Code]] : never>(code: Code, response: T) => ElysiaCustomStatusResponse<Code, T>;
~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1:27 - error TS2307: Cannot find module 'memoirist' or its corresponding type declarations.

1 import { Memoirist } from 'memoirist';
~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1015:135 - error TS2344: Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' does not satisfy the constraint 'SingletonBase'.
Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' is missing the following properties from type 'SingletonBase': decorator, store, derive, resolve

1015 use<const NewElysia extends AnyElysia, const Param extends AnyElysia = this>(plugin: (app: Param) => NewElysia): Elysia<BasePath, Prettify2<Singleton & NewElysia['~Singleton']>, Prettify<Definitions & NewElysia['~Definitions']>, Prettify2<Metadata & NewElysia['~Metadata']>, BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, Prettify2<Ephemeral & NewElysia['~Ephemeral']>, Prettify2<Volatile & NewElysia['~Volatile']>>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1027:8 - error TS2344: Type '{ [K in keyof (Metadata & NewElysia["~Metadata"])]: Metadata & NewElysia["~Metadata"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Metadata & NewElysia["~Metadata"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Metadata"])[K][K]; } : (Metadata & NewElysia["~Metadata"])[K]; }' does not satisfy the constraint 'MetadataBase'.
Type '{ [K in keyof (Metadata & NewElysia["~Metadata"])]: Metadata & NewElysia["~Metadata"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Metadata & NewElysia["~Metadata"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Metadata"])[K][K]; } : (Metadata & NewElysia["~Metadata"])[K]; }' is missing the following properties from type 'MetadataBase': schema, standaloneSchema, macro, macroFn, parser

1027 }, Prettify2<Metadata & NewElysia['~Metadata']>, BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1041:97 - error TS2344: Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' does not satisfy the constraint 'SingletonBase'.
Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' is missing the following properties from type 'SingletonBase': decorator, store, derive, resolve

1041 use(instance: MaybePromise): Elysia<BasePath, Prettify2<Singleton & NewElysia['~Singleton']>, Prettify2<Definitions & NewElysia['~Definitions']>, Prettify2<Metadata & NewElysia['~Metadata']>, BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, Ephemeral, Prettify2<Volatile & NewElysia['~Ephemeral']>>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1051:27 - error TS2344: Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' does not satisfy the constraint 'SingletonBase'.
Type '{ [K in keyof (Singleton & NewElysia["~Singleton"])]: Singleton & NewElysia["~Singleton"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Singleton & NewElysia["~Singleton"])[K]]: ({ ...; } & ... 1 more ... & NewElysia["~Singleton"])[K][K]; } : (Singleton & NewElysia["~Singleton"])[K]; }' is missing the following properties from type 'SingletonBase': decorator, store, derive, resolve

1051 }>): Elysia<BasePath, Prettify2<Singleton & NewElysia['~Singleton']>, {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1068:8 - error TS2344: Type '{ [K in keyof (Metadata & LazyLoadElysia["~Metadata"])]: Metadata & LazyLoadElysia["~Metadata"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Metadata & LazyLoadElysia["~Metadata"])[K]]: ({ ...; } & ... 1 more ... & LazyLoadElysia["~Metadata"])[K][K]; } : (Metadata & LazyLoadElysia["...' does not satisfy the constraint 'MetadataBase'.
Type '{ [K in keyof (Metadata & LazyLoadElysia["~Metadata"])]: Metadata & LazyLoadElysia["~Metadata"] extends { [x: string]: unknown; } ? { [K in keyof ({ [x: string]: unknown; } & Metadata & LazyLoadElysia["~Metadata"])[K]]: ({ ...; } & ... 1 more ... & LazyLoadElysia["~Metadata"])[K][K]; } : (Metadata & LazyLoadElysia["...' is missing the following properties from type 'MetadataBase': schema, standaloneSchema, macro, macroFn, parser

1068 }, Prettify2<Metadata & LazyLoadElysia['~Metadata']>, BasePath extends `` ? Routes & LazyLoadElysia['~Routes'] : Routes & CreateEden<BasePath, LazyLoadElysia['~Routes']>, Ephemeral, Prettify2<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1679:79 - error TS2536: Type 'key' cannot be used to index type 'Definitions["typebox"]'.

1679 [key in keyof NewType]: NewType[key] extends TRef<key & string> ? Definitions['typebox'][key] : NewType[key];
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:223:36 - error TS2536: Type 'key' cannot be used to index type 'A'.

223 [key in keyof B]: IsBothObject<A[key], B[key]> extends true ? Reconcile<A[key], B[key], Override, [
~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:223:77 - error TS2536: Type 'key' cannot be used to index type 'A'.

223 [key in keyof B]: IsBothObject<A[key], B[key]> extends true ? Reconcile<A[key], B[key], Override, [
~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:232:44 - error TS2536: Type 'key' cannot be used to index type 'B'.

232 [key in keyof A]: IsBothObject<A[key], B[key]> extends true ? Reconcile<A[key], B[key], Override, [
~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:232:85 - error TS2536: Type 'key' cannot be used to index type 'B'.

232 [key in keyof A]: IsBothObject<A[key], B[key]> extends true ? Reconcile<A[key], B[key], Override, [
~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:279:277 - error TS2304: Cannot find name 'NamedSchema'.

279 }, '__elysia'>['static'] : Schema extends ${infer Key}[] ? Definitions extends Record<Key, infer NamedSchema extends TAnySchema> ? NamedSchema['static'][] : TImport<Definitions, TrimArrayName>['static'][] : Schema extends string ? Definitions extends keyof Schema ? NamedSchema['static'] : TImport<Definitions, Schema>['static'] : unknown;
~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:284:277 - error TS2304: Cannot find name 'NamedSchema'.

284 }, '__elysia'>['static'] : Schema extends ${infer Key}[] ? Definitions extends Record<Key, infer NamedSchema extends TAnySchema> ? NamedSchema['static'][] : TImport<Definitions, TrimArrayName>['static'][] : Schema extends string ? Definitions extends keyof Schema ? NamedSchema['static'] : TImport<Definitions, Schema>['static'] : unknown;
~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:393:207 - error TS2536: Type '"resolve"' cannot be used to index type 'ReturnTypeIfPossible<MacroFn[key]>'.

393 [key in keyof SelectedMacro as MacroFn[key] extends ResolveMacroFnLike ? key : MacroFn[key] extends ResolveMacroPropertyLike ? true extends SelectedMacro[key] ? key : never : never]: ResolveResolutions<ReturnTypeIfPossible<MacroFn[key]>['resolve']>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:396:57 - error TS2344: Type 'Status' does not satisfy the constraint 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'keyof Route' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string | number | symbol' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.
Type 'string' is not assignable to type 'number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | ... 49 more ... | "Network Authentication Required"'.

396 [Status in keyof Route]: ElysiaCustomStatusResponse<Status, Route[Status]>;
~~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:825:54 - error TS2344: Type 'T' does not satisfy the constraint 'TSchema'.

825 export interface ModelValidator extends TypeCheck {
~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:825:33
825 export interface ModelValidator extends TypeCheck {
~
This type parameter might need an extends TSchema constraint.

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/universal/server.d.ts:1:61 - error TS2307: Cannot find module 'bun' or its corresponding type declarations.

1 import type { Serve as BunServe, Server as BunServer } from 'bun';
~~~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/universal/server.d.ts:204:19 - error TS2503: Cannot find namespace 'Bun'.

204 headers?: Bun.HeadersInit;
~~~

node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/utils.d.ts:149:58 - error TS2536: Type 'number' cannot be used to index type 'A[key]'.

149 [key in keyof A]: IsTuple<A[key]> extends true ? A[key][number] extends Blob | ElysiaFile ? File[] : A[key] : A[key];
~~~~~~~~~~~~~~

Found 33 errors in 7 files.

Errors Files
7 node_modules/.pnpm/@elysiajs+node@1.3.0_elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.coosbemy2n2eblydxf7eqwjpee/node_modules/@elysiajs/node/dist/index.d.ts:3
1 node_modules/.pnpm/@sinclair+typebox@0.34.35/node_modules/@sinclair/typebox/build/cjs/value/assert/assert.d.ts:6
6 node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2
@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/context.d.ts:35
7 node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/index.d.ts:1
9 node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/types.d.ts:223
2 node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/universal/server.d.ts:1
1 node_modules/.pnpm/elysia@1.3.5_exact-mirror@0.1.2_@sinclair+typebox@0.34.35__file-type@21.0.0_typescript@5.8.3/node_modules/elysia/dist/utils.d.ts:149
 ELIFECYCLE  Command failed with exit code 2.`

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Have you try removing the node_modules and bun.lockb and try again yet?

yep

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions