dhiway / cord.js

Cord JS API
Apache License 2.0
69 stars 49 forks source link

`yarn build:docs` failing #57

Closed roynrishingha closed 10 months ago

roynrishingha commented 1 year ago

My current setup

node -v && yarn --version
v18.15.0
3.3.1

Branch dev-0.8.0

The error message I'm receiving

yarn build:docs
Warning: You are running with an unsupported TypeScript version! This may work, or it might break. TypeDoc supports 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7
Error: packages/messaging/src/Message.ts:214:57 - error TS2554: Expected 0-1 arguments, but got 2.

214     throw new SDKErrors.DecodingMessageError(undefined, {
                                                            ~
215       cause: cause as Error,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216     })
    ~~~~~

Error: packages/modules/src/content/Content.ts:193:7 - error TS2554: Expected 0-1 arguments, but got 2.

193       { cause: errors }
          ~~~~~~~~~~~~~~~~~

Error: packages/modules/src/schema/Schema.chain.ts:58:7 - error TS2554: Expected 0-1 arguments, but got 2.

58       { cause }
         ~~~~~~~~~

Error: packages/modules/src/schema/Schema.ts:114:5 - error TS2554: Expected 0-1 arguments, but got 2.

114     { cause: errors }
        ~~~~~~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:26:25 - error TS2304: Cannot find name 'ErrorOptions'.

26   constructor(options?: ErrorOptions) {
                           ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:29:7 - error TS2554: Expected 0-1 arguments, but got 2.

29       options
         ~~~~~~~

Error: packages/utils/src/SDKErrors.ts:138:38 - error TS2304: Cannot find name 'ErrorOptions'.

138   constructor(did: string, options?: ErrorOptions) {
                                         ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:139:44 - error TS2554: Expected 0-1 arguments, but got 2.

139     super(`Not a valid CORD DID "${did}"`, options)
                                               ~~~~~~~

Error: packages/utils/src/SDKErrors.ts:200:25 - error TS2304: Cannot find name 'ErrorOptions'.

200   constructor(options?: ErrorOptions) {
                            ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:203:7 - error TS2554: Expected 0-1 arguments, but got 2.

203       options
          ~~~~~~~
anmode commented 1 year ago

I tried it on my local, same getting error

export class InvalidDidFormatError extends SDKError {
  constructor(did: string, options?: ErrorOptions) {
    super(`Not a valid CORD DID "${did}"`, options)
  }
}

where we are passing two argument it is giving the error. but if we see defination any no. of argument are possible

export class SDKError extends Error {
  constructor(...args: ConstructorParameters<ErrorConstructor>) {
    super(...args)
    this.name = this.constructor.name
  }
}