misskey-dev / misskey

🌎 An interplanetary microblogging platform πŸš€
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.84k stars 1.33k forks source link

Latest version build produces errors #8968

Closed fwn0 closed 1 year ago

fwn0 commented 2 years ago

πŸ’‘ Summary

Latest version build produces errors

🀬 Actual Behavior

~/misskey$ NODE_ENV=production yarn build yarn run v1.22.19 $ node ./scripts/build.js building packages/backend ...

build tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json

node_modules/@tensorflow/tfjs-core/dist/hash_util.d.ts:2:49 - error TS2304: Cannot find name 'Long'.

2 export declare function hexToLong(hex: string): Long;


node_modules/@tensorflow/tfjs-core/dist/hash_util.d.ts:3:69 - error TS2304: Cannot find name 'Long'.

3 export declare function fingerPrint64(s: Uint8Array, len?: number): Long;

node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts:337:37 - error TS2344: Type 'IOHandler[K]' does not satisfy the constraint 'PromiseFunction'. Type 'SaveHandler | LoadHandler | undefined' is not assignable to type 'PromiseFunction'. Type 'undefined' is not assignable to type 'PromiseFunction'.

337 [K in keyof IOHandler]: Syncify<IOHandler[K]>;


node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts:144:22 - error TS2420: Class 'LayersModel' incorrectly implements interface 'InferenceModel'.
  Types of property 'inputs' are incompatible.
    Type 'SymbolicTensor[]' is not assignable to type 'ModelTensorInfo[]'.
      Type 'SymbolicTensor' is not assignable to type 'ModelTensorInfo'.
        Types of property 'shape' are incompatible.
          Type 'Shape' is not assignable to type 'number[]'.
            Type 'number | null' is not assignable to type 'number'.
              Type 'null' is not assignable to type 'number'.

144 export declare class LayersModel extends Container implements tfc.InferenceModel {

node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:17:5 - error TS2411: Property 'input_shape' of type 'Shape | undefined' is not assignable to 'string' index type 'PyJsonValue'.

17 input_shape?: Shape;


node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:18:5 - error TS2411: Property 'batch_input_shape' of type 'Shape | undefined' is not assignable to 'string' index type 'PyJsonValue'.

18     batch_input_shape?: Shape;

node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:19:5 - error TS2411: Property 'batch_size' of type 'number | undefined' is not assignable to 'string' index type 'PyJsonValue'.

19 batch_size?: number;


node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:20:5 - error TS2411: Property 'dtype' of type 'keyof DataTypeMap | undefined' is not assignable to 'string' index type 'PyJsonValue'.

20     dtype?: DataType;

node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:21:5 - error TS2411: Property 'name' of type 'string | undefined' is not assignable to 'string' index type 'PyJsonValue'.

21 name?: string;


node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:22:5 - error TS2411: Property 'trainable' of type 'boolean | undefined' is not assignable to 'string' index type 'PyJsonValue'.

22     trainable?: boolean;

node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:23:5 - error TS2411: Property 'input_dtype' of type 'keyof DataTypeMap | undefined' is not assignable to 'string' index type 'PyJsonValue'.

23 input_dtype?: DataType;


node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:46:5 - error TS2411: Property 'inbound_nodes' of type 'NodeConfig[] | undefined' is not assignable to 'string' index type 'PyJsonValue'.

46     inbound_nodes?: NodeConfig[];

node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts:31:5 - error TS2411: Property 'metrics' of type 'string[] | { [key: string]: string; } | undefined' is not assignable to 'string' index type 'PyJsonValue'.

31 metrics?: MetricsIdentifier[] | {


node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts:34:5 - error TS2411: Property 'weighted_metrics' of type 'string[] | undefined' is not assignable to 'string' index type 'PyJsonValue'.

34     weighted_metrics?: MetricsIdentifier[];

node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts:35:5 - error TS2411: Property 'sample_weight_mode' of type '"temporal" | undefined' is not assignable to 'string' index type 'PyJsonValue'.

35 sample_weight_mode?: SampleWeightMode;


node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts:36:5 - error TS2411: Property 'loss_weights' of type 'LossWeights | undefined' is not assignable to 'string' index type 'PyJsonValue'.

36     loss_weights?: LossWeights;

node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.d.ts:90:5 - error TS2411: Property 'config' of type 'T' is not assignable to 'string' index type 'PyJsonValue'.

90 config: T;


node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts:99:5 - error TS2411: Property 'seed' of type 'number | undefined' is not assignable to 'string' index type 'PyJsonValue'.

99     seed?: number;

node_modules/@types/express-serve-static-core/index.d.ts:501:18 - error TS2430: Interface 'Response' incorrectly extends interface 'ServerResponse'. Types of property 'req' are incompatible. Type 'Request<ParamsDictionary, any, any, Query> | undefined' is not assignable to type 'IncomingMessage'. Type 'undefined' is not assignable to type 'IncomingMessage'.

501 export interface Response extends http.ServerResponse, Express.Response {


node_modules/@types/jsdom/base.d.ts:5:10 - error TS2305: Module '"parse5"' has no exported member 'ElementLocation'.

5 import { ElementLocation } from "parse5";

node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:20:29 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

20 export declare const Text = ElementType.Text;


node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:21:34 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

21 export declare const Directive = ElementType.Directive;

node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:22:32 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

22 export declare const Comment = ElementType.Comment;


node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:23:31 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

23 export declare const Script = ElementType.Script;

node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:24:30 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

24 export declare const Style = ElementType.Style;


node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:25:28 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

25 export declare const Tag = ElementType.Tag;

node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:26:30 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

26 export declare const CDATA = ElementType.CDATA;


node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:27:32 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

27 export declare const Doctype = ElementType.Doctype;

node_modules/ip-address/dist/lib/ipv4.d.ts:2:28 - error TS7016: Could not find a declaration file for module 'jsbn'. '/home/misskey/misskey/packages/backend/node_modules/ip-address/node_modules/jsbn/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/jsbn if it exists or add a new declaration (.d.ts) file containing declare module 'jsbn';

2 import { BigInteger } from 'jsbn';


node_modules/ip-address/dist/lib/ipv6.d.ts:3:28 - error TS7016: Could not find a declaration file for module 'jsbn'. '/home/misskey/misskey/packages/backend/node_modules/ip-address/node_modules/jsbn/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/jsbn` if it exists or add a new declaration (.d.ts) file containing `declare module 'jsbn';`

3 import { BigInteger } from 'jsbn';

node_modules/ip-cidr/index.d.ts:2:28 - error TS7016: Could not find a declaration file for module 'jsbn'. '/home/misskey/misskey/packages/backend/node_modules/ip-cidr/node_modules/jsbn/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/jsbn if it exists or add a new declaration (.d.ts) file containing declare module 'jsbn';

2 import { BigInteger } from "jsbn";


node_modules/pureimage/types/text.d.ts:1:27 - error TS7016: Could not find a declaration file for module 'opentype.js'. '/home/misskey/misskey/packages/backend/node_modules/opentype.js/src/opentype.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/opentype.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'opentype.js';`

1 import * as opentype from 'opentype.js';

node_modules/rss-parser/index.d.ts:1:25 - error TS7016: Could not find a declaration file for module 'xml2js'. '/home/misskey/misskey/packages/backend/node_modules/xml2js/lib/xml2js.js' implicitly has an 'any' type. Try npm i --save-dev @types/xml2js if it exists or add a new declaration (.d.ts) file containing declare module 'xml2js';

1 import { Options } from 'xml2js';


src/boot/master.ts:118:7 - error TS2571: Object is of type 'unknown'.

118   if (exception.code === 'ENOENT') {

src/boot/master.ts:141:18 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string | Error'.

141 dbLogger.error(e); ~

src/db/postgre.ts:2:16 - error TS7016: Could not find a declaration file for module 'pg'. '/home/misskey/misskey/packages/backend/node_modules/pg/lib/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/pg if it exists or add a new declaration (.d.ts) file containing declare module 'pg';

2 import pg from 'pg';


src/misc/app-lock.ts:3:23 - error TS7016: Could not find a declaration file for module 'redis-lock'. '/home/misskey/misskey/packages/backend/node_modules/redis-lock/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/redis-lock` if it exists or add a new declaration (.d.ts) file containing `declare module 'redis-lock';`

3 import redisLock from 'redis-lock';

src/misc/check-word-mute.ts:19:23 - error TS2339: Property 'cw' does not exist on type 'NoteLike'.

19 const text = ((note.cw ?? '') + '\n' + (note.text ?? '')).trim(); ~~

src/misc/emoji-regex.ts:1:21 - error TS7016: Could not find a declaration file for module 'twemoji-parser/dist/lib/regex.js'. '/home/misskey/misskey/packages/backend/node_modules/twemoji-parser/dist/lib/regex.js' implicitly has an 'any' type. Try npm i --save-dev @types/twemoji-parser if it exists or add a new declaration (.d.ts) file containing declare module 'twemoji-parser/dist/lib/regex.js';

1 import twemoji from 'twemoji-parser/dist/lib/regex.js';


src/misc/extract-custom-emojis-from-mfm.ts:9:36 - error TS2532: Object is possibly 'undefined'.

9  return unique(emojiNodes.map(x => x.props.name));

src/misc/extract-custom-emojis-from-mfm.ts:9:44 - error TS2339: Property 'name' does not exist on type 'Record<string, unknown> | { query: string; content: string; } | { code: string; lang: string | null; } | { formula: string; } | { emoji: string; } | { name: string; } | { code: string; } | { formula: string; } | ... 5 more ... | { ...; }'. Property 'name' does not exist on type '{ query: string; content: string; }'.

9 return unique(emojiNodes.map(x => x.props.name));


src/misc/extract-hashtags.ts:6:48 - error TS2532: Object is possibly 'undefined'.

6  const hashtags = unique(hashtagNodes.map(x => x.props.hashtag));

src/misc/extract-hashtags.ts:6:56 - error TS2339: Property 'hashtag' does not exist on type 'Record<string, unknown> | { query: string; content: string; } | { code: string; lang: string | null; } | { formula: string; } | { emoji: string; } | { name: string; } | { code: string; } | { formula: string; } | ... 5 more ... | { ...; }'. Property 'hashtag' does not exist on type '{ query: string; content: string; }'.

6 const hashtags = unique(hashtagNodes.map(x => x.props.hashtag));


src/misc/extract-mentions.ts:10:2 - error TS2322: Type '(Record<string, unknown> | { query: string; content: string; } | { code: string; lang: string | null; } | { formula: string; } | { emoji: string; } | { name: string; } | { code: string; } | { formula: string; } | ... 6 more ... | undefined)[]' is not assignable to type '{ username: string; host: string | null; acct: string; }[]'.
  Type 'Record<string, unknown> | { query: string; content: string; } | { code: string; lang: string | null; } | { formula: string; } | { emoji: string; } | { name: string; } | { code: string; } | { formula: string; } | ... 6 more ... | undefined' is not assignable to type '{ username: string; host: string | null; acct: string; }'.
    Type 'undefined' is not assignable to type '{ username: string; host: string | null; acct: string; }'.

10  return mentions;

src/misc/fetch.ts:49:3 - error TS2345: Argument of type '{ method: string; headers: Record<string, string>; body: string | undefined; timeout: number; size: number; agent: (url: URL, bypassProxy?: boolean) => http.Agent; signal: AbortSignal; }' is not assignable to parameter of type 'RequestInit'. Object literal may only specify known properties, and 'timeout' does not exist in type 'RequestInit'.

49 timeout,


src/misc/get-note-summary.ts:8:11 - error TS2339: Property 'deletedAt' does not exist on type '{ id: string; visibility: string; text: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; user: { id: string; name: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly optional: false; readonly example: "藍"; }>; ... 8 more ...; onlineStatus: SchemaType<....'.

8  if (note.deletedAt) {

src/misc/i18n.ts:16:14 - error TS2352: Conversion of type 'T' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'Record<string, any>' is not comparable to type 'string'.

16 let str = key.split('.').reduce((o, i) => o[i], this.locale) as string;


src/queue/processors/db/export-custom-emojis.ts:5:18 - error TS7016: Could not find a declaration file for module 'mime-types'. '/home/misskey/misskey/packages/backend/node_modules/mime-types/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/mime-types` if it exists or add a new declaration (.d.ts) file containing `declare module 'mime-types';`

5 import mime from 'mime-types';

src/queue/processors/db/export-custom-emojis.ts:6:22 - error TS7016: Could not find a declaration file for module 'archiver'. '/home/misskey/misskey/packages/backend/node_modules/archiver/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/archiver if it exists or add a new declaration (.d.ts) file containing declare module 'archiver';

6 import archiver from 'archiver';


src/queue/processors/db/import-custom-emojis.ts:3:22 - error TS7016: Could not find a declaration file for module 'unzipper'. '/home/misskey/misskey/packages/backend/node_modules/unzipper/unzip.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/unzipper` if it exists or add a new declaration (.d.ts) file containing `declare module 'unzipper';`

3 import unzipper from 'unzipper';

src/remote/activitypub/kernel/announce/note.ts:56:35 - error TS2345: Argument of type 'Note | null' is not assignable to parameter of type 'Note'. Type 'null' is not assignable to type 'Note'.

56 if (!await Notes.isVisibleForMe(renote, actor.id)) return 'skip: invalid actor for this activity';


src/remote/activitypub/kernel/announce/note.ts:56:54 - error TS2322: Type 'string' is not assignable to type 'void'.

56   if (!await Notes.isVisibleForMe(renote, actor.id)) return 'skip: invalid actor for this activity';

src/remote/activitypub/models/note.ts:203:25 - error TS2551: Property '_misskey_content' does not exist on type 'IPost'. Did you mean '_misskey_quote'?

203 } else if (typeof note._misskey_content !== 'undefined') {


  src/remote/activitypub/type.ts:113:2
    113  _misskey_quote?: string;
'_misskey_quote' is declared here.

src/remote/activitypub/models/note.ts:204:15 - error TS2551: Property '_misskey_content' does not exist on type 'IPost'. Did you mean '_misskey_quote'?

204 text = note._misskey_content;


  src/remote/activitypub/type.ts:113:2
    113  _misskey_quote?: string;
'_misskey_quote' is declared here.

src/remote/activitypub/renderer/block.ts:10:21 - error TS2339: Property 'url' does not exist on type 'User'.

10 if (block.blockee?.url == null) {


src/remote/activitypub/resolver.ts:101:11 - error TS2345: Argument of type '(note: Note) => IActivity | Promise<Record<string, unknown>> | null' is not assignable to parameter of type '(value: Note) => Record<string, unknown> | PromiseLike<Record<string, unknown> | null> | null'.
  Type 'IActivity | Promise<Record<string, unknown>> | null' is not assignable to type 'Record<string, unknown> | PromiseLike<Record<string, unknown> | null> | null'.
    Type 'IActivity' is not assignable to type 'Record<string, unknown> | PromiseLike<Record<string, unknown> | null> | null'.
      Type 'IActivity' is not assignable to type 'Record<string, unknown>'.
        Index signature for type 'string' is missing in type 'IActivity'.

101     .then(note => {

src/remote/activitypub/resolver.ts:104:29 - error TS2554: Expected 2 arguments, but got 1.

104 return renderActivity(renderCreate(renderNote(note)));


  src/remote/activitypub/renderer/create.ts:4:30
    4 export default (object: any, note: Note) => {
An argument for 'note' was not provided.

src/remote/activitypub/resolver.ts:114:5 - error TS2322: Type 'Promise<IObject | { [x: string]: string | { name: string; _misskey_votes: number; replies: { type: string; totalItems: number; }; }[]; type: string; id: string; actor: string; content: string; }>' is not assignable to type 'Promise'. Type 'IObject | { [x: string]: string | { name: string; _misskey_votes: number; replies: { type: string; totalItems: number; }; }[]; type: string; id: string; actor: string; content: string; }' is not assignable to type 'IObject'. Type '{ [x: string]: string | { name: string; _misskey_votes: number; replies: { type: string; totalItems: number; }; }[]; type: string; id: string; actor: string; content: string; }' is missing the following properties from type 'IObject': '@context', attributedTo

114 return Promise.all([

115      Notes.findOneByOrFail({ id: parsed.id }),

... 117 ])

118     .then(([note, poll]) => renderQuestion({ id: note.userId }, note, poll));

src/remote/activitypub/resolver.ts:120:5 - error TS2322: Type 'Promise<IObject | IActivity | null>' is not assignable to type 'Promise'. Type 'IObject | IActivity | null' is not assignable to type 'IObject'. Type 'null' is not assignable to type 'IObject'.

120 return NoteReactions.findOneByOrFail({ id: parsed.id }).then(reaction => renderActivity(renderLike(reaction, { uri: null })));


src/remote/activitypub/resolver.ts:120:114 - error TS2345: Argument of type '{ uri: null; }' is not assignable to parameter of type 'Note'.
  Type '{ uri: null; }' is missing the following properties from type 'Note': id, createdAt, replyId, reply, and 30 more.

120     return NoteReactions.findOneByOrFail({ id: parsed.id }).then(reaction => renderActivity(renderLike(reaction, { uri: null })));

src/remote/activitypub/resolver.ts:125:5 - error TS2322: Type 'Promise<IObject | IActivity | null>' is not assignable to type 'Promise'.

125 return Promise.all(

126      [parsed.id, parsed.rest].map(id => Users.findOneByOrFail({ id }))

127 )

128     .then(([follower, followee]) => renderActivity(renderFollow(follower, followee, url)));

src/remote/activitypub/resolver.ts:130:43 - error TS2304: Cannot find name 'type'.

130 throw new Error(resolveLocal: type ${type} unhandled);


src/server/activitypub.ts:62:1 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(name: string, path: string | RegExp, ...middleware: Middleware<DefaultState, DefaultContext & { state: DefaultState; } & RouterParamContext<DefaultState, DefaultContext> & { ...; }>[]): Router<...>', gave the following error.
    Argument of type 'Middleware<DefaultState, DefaultContext, any>' is not assignable to parameter of type 'string | RegExp'.
  Overload 2 of 2, '(path: string | RegExp | (string | RegExp)[], ...middleware: Middleware<DefaultState, import("/home/misskey/misskey/packages/backend/node_modules/@types/koa-compose/node_modules/@types/koa/index").DefaultContext & ExtendableContext & { ...; } & import("/home/misskey/misskey/packages/backend/node_modules/@types/koa/index").DefaultContext>[]): Router<...>', gave the following error.
    Argument of type '(ctx: RouterContext<DefaultState, DefaultContext>) => void' is not assignable to parameter of type 'Middleware<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext>'.
      Types of parameters 'ctx' and 'context' are incompatible.
        Type 'ParameterizedContext<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext & RouterParamContext<...>, any>' is not assignable to type 'RouterContext<DefaultState, DefaultContext>'.
          Type 'ParameterizedContext<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext & RouterParamContext<...>, any>' is not assignable to type 'RouterParamContext<DefaultState, DefaultContext>'.
            The types of 'router.use' are incompatible between these types.
              Type '{ (...middleware: Middleware<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext>[]): Router<...>; (path: string | ... 1 more ... | string[], ...middleware: Middleware<...>[]): Router<...>; }' is not assignable to type '{ (...middleware: Middleware<DefaultState, DefaultContext>[]): Router<DefaultState, DefaultContext>; (path: string | ... 1 more ... | string[], ...middleware: Middleware<...>[]): Router<...>; }'.
                Types of parameters 'middleware' and 'middleware' are incompatible.
                  Types of parameters 'context' and 'context' are incompatible.
                    Type 'ParameterizedContext<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext & RouterParamContext<...>, any>' is not assignable to type 'ParameterizedContext<DefaultState, DefaultContext & RouterParamContext<DefaultState, DefaultContext>, any>'.
                      Type 'ParameterizedContext<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext & RouterParamContext<...>, any>' is not assignable to type 'RouterParamContext<DefaultState, DefaultContext>'.
                        The types returned by 'router.routes()' are incompatible between these types.
                          Type 'Middleware<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext>' is not assignable to type 'Middleware<DefaultState, DefaultContext>'.
                            Type 'DefaultContext' is not assignable to type 'DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext'.

62 router.post('/inbox', json(), inbox);

src/server/activitypub.ts:63:1 - error TS2769: No overload matches this call. Overload 1 of 2, '(name: string, path: string | RegExp, ...middleware: Middleware<DefaultState, DefaultContext & { state: DefaultState; } & RouterParamContext<DefaultState, DefaultContext> & { ...; }>[]): Router<...>', gave the following error. Argument of type 'Middleware<DefaultState, DefaultContext, any>' is not assignable to parameter of type 'string | RegExp'. Overload 2 of 2, '(path: string | RegExp | (string | RegExp)[], ...middleware: Middleware<DefaultState, import("/home/misskey/misskey/packages/backend/node_modules/@types/koa-compose/node_modules/@types/koa/index").DefaultContext & ExtendableContext & { ...; } & import("/home/misskey/misskey/packages/backend/node_modules/@types/koa/index").DefaultContext>[]): Router<...>', gave the following error. Argument of type '(ctx: RouterContext<DefaultState, DefaultContext>) => void' is not assignable to parameter of type 'Middleware<DefaultState, DefaultContext & ExtendableContext & { state: DefaultState; } & DefaultContext>'.

63 router.post('/users/:user/inbox', json(), inbox);


src/server/api/2fa.ts:73:23 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string'.
  Type 'null' is not assignable to type 'string'.

73   Signature.updateHex(certStruct);

src/server/api/api-handler.ts:22:18 - error TS2339: Property 'body' does not exist on type 'Request'.

22 : ctx.request.body;


src/server/api/call.ts:48:10 - error TS2540: Cannot assign to 'key' because it is a read-only property.

48    limit.key = ep.name;

src/server/api/common/read-notification.ts:32:3 - error TS2345: Argument of type '{ notifieeId: string; isRead: boolean; }' is not assignable to parameter of type 'FindManyOptions'. Object literal may only specify known properties, and 'notifieeId' does not exist in type 'FindManyOptions'.

32 notifieeId: userId,


src/server/api/common/read-notification.ts:45:28 - error TS2345: Argument of type '"readNotifications"' is not assignable to parameter of type 'keyof MainStreamTypes'.

45  publishMainStream(userId, 'readNotifications', notificationIds);

src/server/api/common/signin.ts:37:4 - error TS2322: Type 'IncomingHttpHeaders' is not assignable to type '(() => string) | QueryDeepPartialEntity<Record<string, any>> | undefined'.

37 headers: ctx.headers,


src/server/api/endpoints.ts:735:7 - error TS2322: Type '{ name: string | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta") | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/accounts/create") | ... 248 more ... | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/adm...' is not assignable to type 'IEndpoint[]'.
  Type '{ name: string | typeof ep___admin_meta | typeof ep___admin_accounts_create | typeof ep___admin_accounts_delete | typeof ep___admin_ad_create | ... 246 more ... | typeof ep___admin_driveCapOverride; exec: any; meta: any; params: any; }' is not assignable to type 'IEndpoint'.
    Types of property 'name' are incompatible.
      Type 'string | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta") | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/accounts/create") | ... 248 more ... | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/drive...' is not assignable to type 'string'.
        Type 'typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta")' is not assignable to type 'string'.

735 const endpoints: IEndpoint[] = eps.map(([name, ep]) => {

src/server/api/endpoints.ts:738:12 - error TS2339: Property 'default' does not exist on type 'string | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta") | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/accounts/create") | ... 248 more ... | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/drive...'. Property 'default' does not exist on type 'string'.

738 exec: ep.default,


src/server/api/endpoints.ts:739:12 - error TS2339: Property 'meta' does not exist on type 'string | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta") | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/accounts/create") | ... 248 more ... | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/drive...'.
  Property 'meta' does not exist on type 'string'.

739   meta: ep.meta || {},

src/server/api/endpoints.ts:740:14 - error TS2339: Property 'paramDef' does not exist on type 'string | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/meta") | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/accounts/create") | ... 248 more ... | typeof import("/home/misskey/misskey/packages/backend/src/server/api/endpoints/admin/drive...'. Property 'paramDef' does not exist on type 'string'.

740 params: ep.paramDef,


src/server/api/endpoints/admin/drive/show-file.ts:172:39 - error TS2345: Argument of type '(ps: any, me: ILocalUser) => Promise<DriveFile>' is not assignable to parameter of type 'executor<{ readonly tags: readonly ["admin"]; readonly requireCredential: true; readonly requireModerator: true; readonly errors: { readonly noSuchFile: { readonly message: "No such file."; readonly code: "NO_SUCH_FILE"; readonly id: "caf3ca38-c6e5-472e-a30c-b05377dcc240"; }; }; readonly res: { ...; }; }, { ...; }>'.
  Type 'Promise<DriveFile>' is not assignable to type 'Promise<{ type: string; id: string; url: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly format: "url"; }>; name: string; accessKey: string; ... 17 more ...; isLink: SchemaType<...>; } & {} & { ...; }>'.
    Type 'DriveFile' is not assignable to type '{ type: string; id: string; url: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly format: "url"; }>; name: string; accessKey: string; ... 17 more ...; isLink: SchemaType<...>; } & {} & { ...; }'.
      Type 'DriveFile' is not assignable to type '{ type: string; id: string; url: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly format: "url"; }>; name: string; accessKey: string; ... 17 more ...; isLink: SchemaType<...>; }'.
        Types of property 'accessKey' are incompatible.
          Type 'string | null' is not assignable to type 'string'.
            Type 'null' is not assignable to type 'string'.

172 export default define(meta, paramDef, async (ps, me) => {

src/server/api/endpoints/admin/drive/show-file.ts:188:10 - error TS2790: The operand of a 'delete' operator must be optional.

188 delete file.requestIp;


src/server/api/endpoints/admin/drive/show-file.ts:189:10 - error TS2790: The operand of a 'delete' operator must be optional.

189   delete file.requestHeaders;

src/server/api/endpoints/admin/emoji/list.ts:66:39 - error TS2345: Argument of type '(ps: { query: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly default: null; }>; limit: number; } & {} & { query?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly default: null; }> | undefined; limit?: number | undefined; sinceId?: string | undefined; untilId?: string ...' is not assignable to parameter of type 'executor<{ readonly tags: readonly ["admin"]; readonly requireCredential: true; readonly requireModerator: true; readonly res: { readonly type: "array"; readonly optional: false; readonly nullable: false; readonly items: { ...; }; }; }, { ...; }>'. Type 'Promise<({ id: string; url: string; name: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly description: "The local host is represented with null."; }>; category: SchemaType<...>; aliases: string[]; } & {} & { ...; })[]>' is not assignable to type 'Promise<({ id: string; url: string; name: string; host: null; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; })[]>'. Type '({ id: string; url: string; name: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly description: "The local host is represented with null."; }>; category: SchemaType<...>; aliases: string[]; } & {} & { ...; })[]' is not assignable to type '({ id: string; url: string; name: string; host: null; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; })[]'. Type '{ id: string; url: string; name: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly description: "The local host is represented with null."; }>; category: SchemaType<...>; aliases: string[]; } & {} & { ...; }' is not assignable to type '{ id: string; url: string; name: string; host: null; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; }'. Type '{ id: string; url: string; name: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly description: "The local host is represented with null."; }>; category: SchemaType<...>; aliases: string[]; } & {} & { ...; }' is not assignable to type '{ id: string; url: string; name: string; host: null; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; }'. Types of property 'host' are incompatible. Type 'string | null' is not assignable to type 'null'. Type 'string' is not assignable to type 'null'.

66 export default define(meta, paramDef, async (ps) => {


src/server/api/endpoints/admin/meta.ts:339:39 - error TS2345: Argument of type '(ps: {} & {} & {}, me: ILocalUser) => Promise<{ maintainerName: string | null; maintainerEmail: string | null; version: string; name: string | null; uri: string; description: string | null; ... 74 more ...; enableIpLogging: boolean; }>' is not assignable to parameter of type 'executor<{ readonly tags: readonly ["meta"]; readonly requireCredential: true; readonly requireAdmin: true; readonly res: { readonly type: "object"; readonly optional: false; readonly nullable: false; readonly properties: { ...; }; }; }, { ...; }>'.
  Type 'Promise<{ maintainerName: string | null; maintainerEmail: string | null; version: string; name: string | null; uri: string; description: string | null; langs: string[]; tosUrl: string | null; ... 72 more ...; enableIpLogging: boolean; }>' is not assignable to type 'Promise<{ emojis: ({ id: string; url: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; })[]; ... 21 more ...; proxyAccoun...'.
    Type '{ maintainerName: string | null; maintainerEmail: string | null; version: string; name: string | null; uri: string; description: string | null; langs: string[]; tosUrl: string | null; ... 72 more ...; enableIpLogging: boolean; }' is not assignable to type '{ emojis: ({ id: string; url: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; })[]; ... 21 more ...; proxyAccountName: S...'.
      Type '{ maintainerName: string | null; maintainerEmail: string | null; version: string; name: string | null; uri: string; description: string | null; langs: string[]; tosUrl: string | null; ... 72 more ...; enableIpLogging: boolean; }' is missing the following properties from type '{ emojis: ({ id: string; url: string; host: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; category: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; aliases: string[]; } & {} & { ...; })[]; ... 21 more ...; proxyAccountName: S...': emojis, ads, proxyAccountName

339 export default define(meta, paramDef, async (ps, me) => {

src/server/api/endpoints/drive/files/create.ts:77:23 - error TS2448: Block-scoped variable 'meta' used before its declaration.

77 throw new ApiError(meta.errors.invalidFileName);


  src/server/api/endpoints/drive/files/create.ts:83:8
    83  const meta = await fetchMeta();
'meta' is declared here.

src/server/api/endpoints/drive/files/create.ts:77:23 - error TS2454: Variable 'meta' is used before being assigned.

77 throw new ApiError(meta.errors.invalidFileName);


src/server/api/endpoints/drive/files/create.ts:77:28 - error TS2339: Property 'errors' does not exist on type 'Meta'.

77    throw new ApiError(meta.errors.invalidFileName);

src/server/api/endpoints/drive/files/create.ts:104:81 - error TS2339: Property 'errors' does not exist on type 'Meta'.

104 if (e.id === '282f77bf-5816-4f72-9264-aa14d8261a21') throw new ApiError(meta.errors.inappropriate);


src/server/api/endpoints/drive/files/create.ts:105:81 - error TS2339: Property 'errors' does not exist on type 'Meta'.

105    if (e.id === 'c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6') throw new ApiError(meta.errors.noFreeSpace);

src/server/api/endpoints/endpoint.ts:25:10 - error TS2532: Object is possibly 'undefined'.

25 type: v.type.charAt(0).toUpperCase() + v.type.slice(1),


src/server/api/endpoints/endpoint.ts:25:43 - error TS2532: Object is possibly 'undefined'.

25    type: v.type.charAt(0).toUpperCase() + v.type.slice(1),

src/server/api/endpoints/i/authorized-apps.ts:34:57 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string | App'. Type 'null' is not assignable to type 'string | App'.

34 return await Promise.all(tokens.map(token => Apps.pack(token.appId, user, {


src/server/api/endpoints/i/update.ts:125:29 - error TS2345: Argument of type '{ readonly type: "object"; readonly properties: { readonly name: { readonly nullable: true; readonly type: "string"; readonly minLength: 1; readonly maxLength: 50; }; readonly description: { readonly nullable: true; readonly type: "string"; readonly minLength: 1; readonly maxLength: 500; }; ... 25 more ...; readonly...' is not assignable to parameter of type 'Schema'.
  Types of property 'properties' are incompatible.
    Type '{ readonly name: { readonly nullable: true; readonly type: "string"; readonly minLength: 1; readonly maxLength: 50; }; readonly description: { readonly nullable: true; readonly type: "string"; readonly minLength: 1; readonly maxLength: 500; }; ... 25 more ...; readonly emailNotificationTypes: { ...; }; }' is not assignable to type 'Obj'.
      Property 'lang' is incompatible with index signature.
        Type '{ readonly type: "string"; readonly enum: readonly [null, ...string[]]; readonly nullable: true; }' is not assignable to type 'Schema'.
          Types of property 'enum' are incompatible.
            Type 'readonly [null, ...string[]]' is not assignable to type 'readonly string[]'.
              Type 'string | null' is not assignable to type 'string'.
                Type 'null' is not assignable to type 'string'.

125 export default define(meta, paramDef, async (ps, _user, token) => {

src/server/api/endpoints/i/update.ts:144:24 - error TS7006: Parameter 'x' implicitly has an 'any' type.

144 ps.mutedWords.filter(x => !Array.isArray(x)).forEach(x => { ~

src/server/api/endpoints/i/update.ts:144:56 - error TS7006: Parameter 'x' implicitly has an 'any' type.

144 ps.mutedWords.filter(x => !Array.isArray(x)).forEach(x => { ~

src/server/api/endpoints/i/update.ts:202:12 - error TS7006: Parameter 'x' implicitly has an 'any' type.

202 .filter(x => typeof x.name === 'string' && x.name !== '' && typeof x.value === 'string' && x.value !== '') ~

src/server/api/endpoints/i/update.ts:203:9 - error TS7006: Parameter 'x' implicitly has an 'any' type.

203 .map(x => { ~

src/server/api/endpoints/i/update.ts:244:49 - error TS2345: Argument of type 'UserProfile | null' is not assignable to parameter of type 'UserProfile | undefined'. Type 'null' is not assignable to type 'UserProfile | undefined'.

244 publishUserEvent(user.id, 'updateUserProfile', await UserProfiles.findOneBy({ userId: user.id }));


src/server/api/endpoints/messaging/messages.ts:72:39 - error TS2345: Argument of type '(ps: { limit: number; markAsRead: SchemaType<{ readonly type: "boolean"; readonly default: true; }>; } & {} & { limit?: number | undefined; sinceId?: string | undefined; untilId?: string | undefined; markAsRead?: SchemaType<...> | undefined; }, user: ILocalUser) => Promise<...>' is not assignable to parameter of type 'executor<{ readonly tags: readonly ["messaging"]; readonly requireCredential: true; readonly kind: "read:messaging"; readonly res: { readonly type: "array"; readonly optional: false; readonly nullable: false; readonly items: { ...; }; }; readonly errors: { ...; }; }, { ...; }>'.
  Type 'Promise<({ id: string; text: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; createdAt: string; userId: string; recipientId: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<...>; ...' is not assignable to type 'Promise<({ id: string; text: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; createdAt: string; userId: string; recipientId: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<...>; ...'. Two different types with this name exist, but they are unrelated.
    Type '({ id: string; text: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; createdAt: string; userId: string; recipientId: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<...>; groupId:...' is not assignable to type '({ id: string; text: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; createdAt: string; userId: string; recipientId: import("/home/misskey/misskey/packages/backend/src/misc/schema").SchemaType<...>; groupId:...'. Two different types with this name exist, but they are unrelated.
      Type 'undefined' is not assignable to type '({ id: string; text: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; }>; createdAt: string; userId: string; recipientId: SchemaType<{ readonly type: "string"; readonly optional: false; readonly nullable: true; readonly format: "id"; }>; groupId: SchemaType<...>; } & {} & { .....'.

72 export default define(meta, paramDef, async (ps, user) => {

src/server/api/endpoints/messaging/messages.ts:72:39 - error TS7030: Not all code paths return a value.

72 export default define(meta, paramDef, async (ps, user) => {


src/server/api/endpoints/messaging/messages.ts:73:9 - error TS2339: Property 'userId' does not exist on type '{ limit: number; markAsRead: SchemaType<{ readonly type: "boolean"; readonly default: true; }>; } & {} & { limit?: number | undefined; sinceId?: string | undefined; untilId?: string | undefined; markAsRead?: SchemaType<...> | undefined; }'.

73  if (ps.userId != null) {

src/server/api/endpoints/messaging/messages.ts:75:38 - error TS2339: Property 'userId' does not exist on type '{ limit: number; markAsRead: SchemaType<{ readonly type: "boolean"; readonly default: true; }>; } & {} & { limit?: number | undefined; sinceId?: string | undefined; untilId?: string | undefined; markAsRead?: SchemaType<...> | undefined; }'.

75 const recipient = await getUser(ps.userId).catch(e => {


src/server/api/endpoints/messaging/messages.ts:109:16 - error TS2339: Property 'groupId' does not exist on type '{ limit: number; markAsRead: SchemaType<{ readonly type: "boolean"; readonly default: true; }>; } & {} & { limit?: number | undefined; sinceId?: string | undefined; untilId?: string | undefined; markAsRead?: SchemaType<...> | undefined; }'.

109  } else if (ps.groupId != null) {

src/server/api/endpoints/messaging/messages.ts:111:62 - error TS2339: Property 'groupId' does not exist on type '{ limit: number; markAsRead: SchemaType<{ readonly type: "boolean"; readonly default: true; }>; } & {} & { limit?: number | undefined; sinceId?: string | undefined; untilId?: string | undefined; markAsRead?: SchemaType<...> | undefined; }'.

111 const recipientGroup = await UserGroups.findOneBy({ id: ps.groupId });


src/server/api/endpoints/messaging/messages/create.ts:94:9 - error TS2339: Property 'userId' does not exist on type '{} & {} & { text?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly maxLength: 3000; }> | undefined; fileId?: string | undefined; }'.

94  if (ps.userId != null) {

src/server/api/endpoints/messaging/messages/create.ts:96:10 - error TS2339: Property 'userId' does not exist on type '{} & {} & { text?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly maxLength: 3000; }> | undefined; fileId?: string | undefined; }'.

96 if (ps.userId === user.id) {


src/server/api/endpoints/messaging/messages/create.ts:101:36 - error TS2339: Property 'userId' does not exist on type '{} & {} & { text?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly maxLength: 3000; }> | undefined; fileId?: string | undefined; }'.

101   recipientUser = await getUser(ps.userId).catch(e => {

src/server/api/endpoints/messaging/messages/create.ts:114:16 - error TS2339: Property 'groupId' does not exist on type '{} & {} & { text?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly maxLength: 3000; }> | undefined; fileId?: string | undefined; }'.

114 } else if (ps.groupId != null) {


src/server/api/endpoints/messaging/messages/create.ts:116:56 - error TS2339: Property 'groupId' does not exist on type '{} & {} & { text?: SchemaType<{ readonly type: "string"; readonly nullable: true; readonly maxLength: 3000; }> | undefined; fileId?: string | undefined; }'.

116   recipientGroup = await UserGroups.findOneBy({ id: ps.groupId! });

src/server/api/endpoints/messaging/messages/create.ts:150:35 - error TS2345: Argument of type 'User | null' is not assignable to parameter of type 'CacheableUser | undefined'. Type 'null' is not assignable to type 'CacheableUser | undefined'.

150 return await createMessage(user, recipientUser, recipientGroup, ps.text, file);


src/server/api/endpoints/messaging/messages/create.ts:150:35 - error TS2454: Variable 'recipientUser' is used before being assigned.

150  return await createMessage(user, recipientUser, recipientGroup, ps.text, file);

src/server/api/endpoints/messaging/messages/create.ts:150:50 - error TS2454: Variable 'recipientGroup' is used before being assigned.

150 return await createMessage(user, recipientUser, recipientGroup, ps.text, file);


src/server/api/endpoints/notes/search-by-tag.ts:88:10 - error TS2339: Property 'tag' does not exist on type '{ reply: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; renote: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; poll: SchemaType<...>; limit: number; withFiles: SchemaType<...>; } & {} & { ...; }'.

88   if (ps.tag) {

src/server/api/endpoints/notes/search-by-tag.ts:89:23 - error TS2339: Property 'tag' does not exist on type '{ reply: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; renote: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; poll: SchemaType<...>; limit: number; withFiles: SchemaType<...>; } & {} & { ...; }'.

89 if (!safeForSql(ps.tag)) throw 'Injection';


src/server/api/endpoints/notes/search-by-tag.ts:90:47 - error TS2339: Property 'tag' does not exist on type '{ reply: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; renote: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; poll: SchemaType<...>; limit: number; withFiles: SchemaType<...>; } & {} & { ...; }'.

90    query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`);

src/server/api/endpoints/notes/search-by-tag.ts:93:27 - error TS2339: Property 'query' does not exist on type '{ reply: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; renote: SchemaType<{ readonly type: "boolean"; readonly nullable: true; readonly default: null; }>; poll: SchemaType<...>; limit: number; withFiles: SchemaType<...>; } & {} & { ...; }'.

93 for (const tags of ps.query!) {


src/server/api/endpoints/users/followers.ts:70:40 - error TS2339: Property 'userId' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

70  const user = await Users.findOneBy(ps.userId != null

src/server/api/endpoints/users/followers.ts:71:14 - error TS2339: Property 'userId' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

71 ? { id: ps.userId }


src/server/api/endpoints/users/followers.ts:72:25 - error TS2339: Property 'username' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

72   : { usernameLower: ps.username!.toLowerCase(), host: toPunyNullable(ps.host) ?? IsNull() });

src/server/api/endpoints/users/followers.ts:72:74 - error TS2339: Property 'host' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

72 : { usernameLower: ps.username!.toLowerCase(), host: toPunyNullable(ps.host) ?? IsNull() });


src/server/api/endpoints/users/following.ts:70:40 - error TS2339: Property 'userId' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

70  const user = await Users.findOneBy(ps.userId != null

src/server/api/endpoints/users/following.ts:71:14 - error TS2339: Property 'userId' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

71 ? { id: ps.userId }


src/server/api/endpoints/users/following.ts:72:25 - error TS2339: Property 'username' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

72   : { usernameLower: ps.username!.toLowerCase(), host: toPunyNullable(ps.host) ?? IsNull() });

src/server/api/endpoints/users/following.ts:72:74 - error TS2339: Property 'host' does not exist on type '{ limit: number; } & {} & { sinceId?: string | undefined; untilId?: string | undefined; limit?: number | undefined; }'.

72 : { usernameLower: ps.username!.toLowerCase(), host: toPunyNullable(ps.host) ?? IsNull()


Found 171 errors in 66 files.

Errors  Files
     2  node_modules/@tensorflow/tfjs-core/dist/hash_util.d.ts:2
     1  node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts:337
     1  node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts:144
     8  node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts:17
     4  node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts:31
     1  node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.d.ts:90
     1  node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts:99
     1  node_modules/@types/express-serve-static-core/index.d.ts:501
     1  node_modules/@types/jsdom/base.d.ts:5
     8  node_modules/htmlparser2/node_modules/domelementtype/lib/index.d.ts:20
     1  node_modules/ip-address/dist/lib/ipv4.d.ts:2
     1  node_modules/ip-address/dist/lib/ipv6.d.ts:3
     1  node_modules/ip-cidr/index.d.ts:2
     1  node_modules/pureimage/types/text.d.ts:1
     1  node_modules/rss-parser/index.d.ts:1
     2  src/boot/master.ts:118
     1  src/db/postgre.ts:2
     1  src/misc/app-lock.ts:3
     1  src/misc/check-word-mute.ts:19
     1  src/misc/emoji-regex.ts:1
     2  src/misc/extract-custom-emojis-from-mfm.ts:9
     2  src/misc/extract-hashtags.ts:6
     1  src/misc/extract-mentions.ts:10
     1  src/misc/fetch.ts:49
     1  src/misc/get-note-summary.ts:8
     1  src/misc/i18n.ts:16
     2  src/queue/processors/db/export-custom-emojis.ts:5
     1  src/queue/processors/db/import-custom-emojis.ts:3
     2  src/remote/activitypub/kernel/announce/note.ts:56
     2  src/remote/activitypub/models/note.ts:203
     1  src/remote/activitypub/renderer/block.ts:10
     7  src/remote/activitypub/resolver.ts:101
     2  src/server/activitypub.ts:62
     1  src/server/api/2fa.ts:73
     1  src/server/api/api-handler.ts:22
     1  src/server/api/call.ts:48
     2  src/server/api/common/read-notification.ts:32
     1  src/server/api/common/signin.ts:37
     4  src/server/api/endpoints.ts:735
     3  src/server/api/endpoints/admin/drive/show-file.ts:172
     1  src/server/api/endpoints/admin/emoji/list.ts:66
     1  src/server/api/endpoints/admin/meta.ts:339
     5  src/server/api/endpoints/drive/files/create.ts:77
     2  src/server/api/endpoints/endpoint.ts:25
     1  src/server/api/endpoints/i/authorized-apps.ts:34
     6  src/server/api/endpoints/i/update.ts:125
     6  src/server/api/endpoints/messaging/messages.ts:72
     8  src/server/api/endpoints/messaging/messages/create.ts:94
     4  src/server/api/endpoints/notes/search-by-tag.ts:88
     4  src/server/api/endpoints/users/followers.ts:70
     4  src/server/api/endpoints/users/following.ts:70
     3  src/server/api/endpoints/users/stats.ts:119
     3  src/server/api/openapi/gen-spec.ts:66
     2  src/server/api/private/signin.ts:19
     3  src/server/api/private/signup-pending.ts:7
     2  src/server/api/private/signup.ts:14
     5  src/server/api/service/discord.ts:150
     4  src/server/api/service/github.ts:148
     2  src/server/api/service/twitter.ts:153
     5  src/server/index.ts:61
     1  src/server/nodeinfo.ts:97
     1  src/server/web/manifest.ts:3
     1  src/server/web/url-preview.ts:34
    15  src/services/chart/core.ts:245
     1  src/services/drive/upload-from-url.ts:56
     4  src/services/logger.ts:3
done.
building packages/client ...

## πŸ“ Steps to Reproduce

1. update or fresh install - (both same errors on NODE_ENV=production yarn build)

2. yarn install = OK

3. NODE_ENV=production yarn build = errors

4. systemctl status misskey

Jul 08 14:18:00 bullseye misskey[23069]: INFO *        [core boot]        Starting 1 worker...
Jul 08 14:18:01 bullseye misskey[23081]: (node:23081) ExperimentalWarning: Importing JSON modules is an experimental feature. This featu>
Jul 08 14:18:01 bullseye misskey[23081]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 08 14:18:02 bullseye misskey[23069]: ERR  *        [core cluster]        [1] died :(
Jul 08 14:18:03 bullseye misskey[23094]: (node:23094) ExperimentalWarning: Importing JSON modules is an experimental feature. This featu>
Jul 08 14:18:03 bullseye misskey[23094]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 08 14:18:04 bullseye misskey[23069]: ERR  *        [core cluster]        [2] died :(
Jul 08 14:18:05 bullseye misskey[23107]: (node:23107) ExperimentalWarning: Importing JSON modules is an experimental feature. This featu>
Jul 08 14:18:05 bullseye misskey[23107]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 08 14:18:06 bullseye misskey[23069]: ERR  *        [core cluster]        [3] died :(

5. NODE_ENV=production npm start

> misskey@12.112.2 start
> cd packages/backend && node --experimental-json-modules ./built/index.js

  _____ _         _           
 |     |_|___ ___| |_ ___ _ _ 
 | | | | |_ -|_ -| '_| -_| | |
 |_|_|_|_|___|___|_,_|___|_  |
 v12.112.2               |___|

 Misskey is an open-source decentralized microblogging platform.
 If you like Misskey, please donate to support development. https://www.patreon.com/syuilo

--- bullseye (PID: 35136) ---
INFO *  [core boot] Welcome to Misskey!
INFO *  [core boot] Misskey v12.112.2
INFO *  [core boot env] NODE_ENV: production
INFO *  [core boot nodejs]  Version v16.15.1 detected.
DONE *  [core boot config]  Loaded
INFO *  [core boot db]  Connecting...
DONE *  [core boot db]  Connected: v13.7 (Debian 13.7-0+deb11u1)
DONE *  [core boot] Misskey initialized
INFO *  [core boot] Starting 1 worker...
(node:35148) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ERR  *  [core cluster]  [1] died :(
(node:35161) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ERR  *  [core cluster]  [2] died :(
(node:35174) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ERR  *  [core cluster]  [3] died :(
(node:35187) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ERR  *  [core cluster]  [4] died :(
(node:35200) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

5. Webserver 502 error - 502 Bad Gateway

6. CPU increase 50 % usage after systemctl start misskey

## πŸ“Œ Environment

VPS

Misskey version: 12.112.2
Your OS: Debian 11.3 (Qemu)
Node: 16.15.1
nexryai commented 2 years ago

I have encountered this same problem when updating instances installed using bash scripts. (https://misskey-hub.net/docs/install/bash.html#_4-%E3%82%A2%E3%83%83%E3%83%95%E3%82%9A%E3%83%86%E3%82%99%E3%83%BC%E3%83%88%E3%81%99%E3%82%8B)

journalctl log

Jul 09 10:06:46 poweredge "misskey.sda1.net"[198]: > misskey@12.112.2 start
Jul 09 10:06:46 poweredge "misskey.sda1.net"[198]: > cd packages/backend && node --experimental-json-modules ./built/index.js
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:   _____ _         _
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  |     |_|___ ___| |_ ___ _ _
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  | | | | |_ -|_ -| '_| -_| | |
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  |_|_|_|_|___|___|_,_|___|_  |
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  v12.112.2               |___|
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  Misskey is an open-source decentralized microblogging platform.
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  If you like Misskey, please donate to support development. https://www.patreon.com/syuilo
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: --- poweredge (PID: 211) ---
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Welcome to Misskey!
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Misskey v12.112.2
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot env]        NODE_ENV: production
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot nodejs]        Version v18.5.0 detected.
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: DONE *        [core boot config]        Loaded
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot db]        Connecting...
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: DONE *        [core boot db]        Connected: v13.7 (Ubuntu 13.7-1.pgdg20.04+1)
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: DONE *        [core boot]        Misskey initialized
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Starting 1 worker...
Jul 09 10:06:48 poweredge sudo[235]:    suser : TTY=pts/1 ; PWD=/home/suser ; USER=root ; COMMAND=/usr/bin/systemctl status misskey.sda1.net
Jul 09 10:06:48 poweredge sudo[235]: pam_unix(sudo:session): session opened for user root by suser(uid=0)
Jul 09 10:06:48 poweredge "misskey.sda1.net"[223]: (node:223) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:48 poweredge "misskey.sda1.net"[223]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:50 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [1] died :(
Jul 09 10:06:51 poweredge sudo[235]: pam_unix(sudo:session): session closed for user root
Jul 09 10:06:52 poweredge "misskey.sda1.net"[239]: (node:239) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:52 poweredge "misskey.sda1.net"[239]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:53 poweredge systemd-journald[20]: Forwarding to syslog missed 42 messages.
-- Subject: One or more messages could not be forwarded to syslog
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- One or more messages could not be forwarded to the syslog service
-- running side-by-side with journald. This usually indicates that the
-- syslog implementation has not been able to keep up with the speed of
-- messages queued.
Jul 09 10:06:53 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [2] died :(
Jul 09 10:06:55 poweredge "misskey.sda1.net"[255]: (node:255) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:55 poweredge "misskey.sda1.net"[255]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:57 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [3] died :(
Jul 09 10:06:58 poweredge "misskey.sda1.net"[268]: (node:268) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:58 poweredge "misskey.sda1.net"[268]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:07:00 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [4] died :(
Jul 09 10:07:01 poweredge "misskey.sda1.net"[281]: (node:281) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time

enviroment

OS: ubuntu 20.04 Misskey: v12.112.2 node: v18.5.0

mei23 commented 2 years ago

What's your cpu architecture? uname -a

nexryai commented 2 years ago

It's x86_64

USERNAME@poweredge:~$  uname -a
Linux poweredge 5.14.21-150400.22-default #1 SMP PREEMPT_DYNAMIC Wed May 11 06:57:18 UTC 2022 (49db222) x86_64 x86_64 x86_64 GNU/Linux
fwn0 commented 2 years ago

I did try again new build with new updated node to 16.16.0, but still same results. Linux bullseye 5.18.0-0.bpo.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.2-1~bpo11+1 (2022-06-14) x86_64 GNU/Linux

fwn0 commented 2 years ago

or .... maybe ... I did copy -R my config.yaml from broken Misskey to fresh install of Misskey. Is it possible, that in these new builds are some breaking changes in Misskey default.yaml template?

ThatOneCalculator commented 2 years ago

This solution worked for me:

yarn add @tensorflow/tfjs
yarn add @tensorflow/tfjs-core
yarn add seedrandom
yarn add long

then rebuild :)

fwn0 commented 2 years ago

@ThatOneCalculator: No success with your solution. Which node version do you run ?

ThatOneCalculator commented 2 years ago

V18.4.0 + Yarn 3.2.1

Screenshot_20220709-111858_1.png

yzhe819 commented 2 years ago

The same problem happened on my server too. I used the latest version to build. a4b5a0072d427ba2be4170041f98c11f8ea13e44 But the backend still build failed.

nexryai commented 2 years ago

I have encountered this same problem when updating instances installed using bash scripts. (https://misskey-hub.net/docs/install/bash.html#_4-%E3%82%A2%E3%83%83%E3%83%95%E3%82%9A%E3%83%86%E3%82%99%E3%83%BC%E3%83%88%E3%81%99%E3%82%8B)

journalctl log

Jul 09 10:06:46 poweredge "misskey.sda1.net"[198]: > misskey@12.112.2 start
Jul 09 10:06:46 poweredge "misskey.sda1.net"[198]: > cd packages/backend && node --experimental-json-modules ./built/index.js
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:   _____ _         _
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  |     |_|___ ___| |_ ___ _ _
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  | | | | |_ -|_ -| '_| -_| | |
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  |_|_|_|_|___|___|_,_|___|_  |
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  v12.112.2               |___|
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  Misskey is an open-source decentralized microblogging platform.
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]:  If you like Misskey, please donate to support development. https://www.patreon.com/syuilo
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: --- poweredge (PID: 211) ---
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Welcome to Misskey!
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Misskey v12.112.2
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot env]        NODE_ENV: production
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot nodejs]        Version v18.5.0 detected.
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: DONE *        [core boot config]        Loaded
Jul 09 10:06:46 poweredge "misskey.sda1.net"[211]: INFO *        [core boot db]        Connecting...
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: DONE *        [core boot db]        Connected: v13.7 (Ubuntu 13.7-1.pgdg20.04+1)
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: DONE *        [core boot]        Misskey initialized
Jul 09 10:06:47 poweredge "misskey.sda1.net"[211]: INFO *        [core boot]        Starting 1 worker...
Jul 09 10:06:48 poweredge sudo[235]:    suser : TTY=pts/1 ; PWD=/home/suser ; USER=root ; COMMAND=/usr/bin/systemctl status misskey.sda1.net
Jul 09 10:06:48 poweredge sudo[235]: pam_unix(sudo:session): session opened for user root by suser(uid=0)
Jul 09 10:06:48 poweredge "misskey.sda1.net"[223]: (node:223) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:48 poweredge "misskey.sda1.net"[223]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:50 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [1] died :(
Jul 09 10:06:51 poweredge sudo[235]: pam_unix(sudo:session): session closed for user root
Jul 09 10:06:52 poweredge "misskey.sda1.net"[239]: (node:239) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:52 poweredge "misskey.sda1.net"[239]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:53 poweredge systemd-journald[20]: Forwarding to syslog missed 42 messages.
-- Subject: One or more messages could not be forwarded to syslog
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- One or more messages could not be forwarded to the syslog service
-- running side-by-side with journald. This usually indicates that the
-- syslog implementation has not been able to keep up with the speed of
-- messages queued.
Jul 09 10:06:53 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [2] died :(
Jul 09 10:06:55 poweredge "misskey.sda1.net"[255]: (node:255) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:55 poweredge "misskey.sda1.net"[255]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:06:57 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [3] died :(
Jul 09 10:06:58 poweredge "misskey.sda1.net"[268]: (node:268) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
Jul 09 10:06:58 poweredge "misskey.sda1.net"[268]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 09 10:07:00 poweredge "misskey.sda1.net"[211]: ERR  *        [core cluster]        [4] died :(
Jul 09 10:07:01 poweredge "misskey.sda1.net"[281]: (node:281) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time

enviroment

OS: ubuntu 20.04 Misskey: v12.112.2 node: v18.5.0

I updated to the latest version(v12.113.0) today and all went well.

tamaina commented 1 year ago

If this happens with the latest Misskey, please Reopen it.