Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript compile error with 1.21.3 #367

Closed
steve-baldwin opened this issue Mar 27, 2023 · 7 comments
Closed

Typescript compile error with 1.21.3 #367

steve-baldwin opened this issue Mar 27, 2023 · 7 comments

Comments

@steve-baldwin
Copy link

Upgrading from 1.21.2 to 1.21.3 causes this:

[~/git/koopa-api] yarn tsc:check
yarn run v1.22.19
$ tsc --noEmit
node_modules/axios-mock-adapter/types/index.d.ts:55:6 - error TS2702: 'AxiosAdapter' only refers to a type, but is being used as a namespace here.

55 ) => AxiosAdapter.RequestHandler;
        ~~~~~~~~~~~~


Found 1 error in node_modules/axios-mock-adapter/types/index.d.ts:55

In case it matters, this is with:

  • node 18.14.2
  • typescript 5.0.2

The following tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true
  },
  "exclude": ["jest.config.js"]
}
@m-radzikowski
Copy link

It also causes eslint to fail on @typescript-eslint/no-unsafe-member-access and @typescript-eslint/no-unsafe-call checks:

axiosMock.onPost().reply(200, '...');

eslint with plugin:@typescript-eslint/recommended-requiring-type-checking:

  44:2  error  Unsafe member access .reply on an `any` value  @typescript-eslint/no-unsafe-member-access
  44:2  error  Unsafe call of an `any` typed value            @typescript-eslint/no-unsafe-call

@waynemock
Copy link

I'm seeing this issue as well

It also causes eslint to fail on @typescript-eslint/no-unsafe-member-access and @typescript-eslint/no-unsafe-call checks:

axiosMock.onPost().reply(200, '...');

eslint with plugin:@typescript-eslint/recommended-requiring-type-checking:

  44:2  error  Unsafe member access .reply on an `any` value  @typescript-eslint/no-unsafe-member-access
  44:2  error  Unsafe call of an `any` typed value            @typescript-eslint/no-unsafe-call

@remcohaszing
Copy link
Contributor

This was fixed by #368, but it's not yet released.

@pdbhoi
Copy link

pdbhoi commented Apr 1, 2023

This was fixed by #368, but it's not yet released.

Hello Sir
When this will release #368

@marcbachmann
Copy link
Collaborator

Released as v1.21.4

@pdbhoi
Copy link

pdbhoi commented Apr 1, 2023

Released as v1.21.4

Thank you sir

@mgrejanin
Copy link

I'm seeing this issue as well

It also causes eslint to fail on @typescript-eslint/no-unsafe-member-access and @typescript-eslint/no-unsafe-call checks:
axiosMock.onPost().reply(200, '...');
eslint with plugin:@typescript-eslint/recommended-requiring-type-checking:

  44:2  error  Unsafe member access .reply on an `any` value  @typescript-eslint/no-unsafe-member-access
  44:2  error  Unsafe call of an `any` typed value            @typescript-eslint/no-unsafe-call

I'm getting these typing errors while using v1.21.4. Rolling back to version 1.21.2 works fine.

Any solution here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants