swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

13.0.22 is broken: [error] TypeError: Cannot read properties of undefined (reading 'split')

Open OnkelTem opened this issue 1 year ago • 2 comments

The latest version (13.0.22) seems to be broken. For any swagger-spec I tried I always receive:

ℹ start generating your typescript api
[error] TypeError: Cannot read properties of undefined (reading 'split')

Which version we can use?

OnkelTem avatar Sep 23 '24 11:09 OnkelTem

Trying 13.0.21: same error.

OnkelTem avatar Sep 23 '24 11:09 OnkelTem

More detailed trace back:

main (yarn): no error 13.0.22 (yarn): [error] TypeError: Cannot read properties of undefined (reading 'split') 13.0.21 (yarn): [error] TypeError: Cannot read properties of undefined (reading 'split') 13.0.20 (yarn): [error] TypeError: e.values(...).some is not a function 13.0.19 (yarn): [error] TypeError: e.values(...).some is not a function 13.0.18 (yarn): [error] TypeError: u.merge is not a function 13.0.17 (yarn): [error] TypeError: u.merge is not a function 13.0.16 (pnpm): no error

Code used for testing:

  async generate() {
    const { files } = await generateApi({
      output: false,
      input: this.specLocalPath,
      moduleNameFirstTag: true,
      moduleNameIndex: 1,
    })
   // ...
  }

Swagger used for testing: petstore.yaml

So the most recent working version is 13.0.16

OnkelTem avatar Sep 23 '24 12:09 OnkelTem

Same error here - my solution: image

Argeento avatar Jan 15 '25 16:01 Argeento

@Argeento I expect you shouldn't use ^ before the version specifier, as npm will update it back to 13.0.23.

Use the specific version like "13.0.16" (this one works).

OnkelTem avatar Jan 21 '25 20:01 OnkelTem

@js2me Any updates on this?

The issue persist in the latest 13.0.23 version.

OnkelTem avatar Jan 21 '25 20:01 OnkelTem

It should be fixed in the latest release.

smorimoto avatar Mar 24 '25 09:03 smorimoto