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

Cannot use with typescript: Adapter is not assignable to parameter of type Newable<any> #504

Open
kuba-orlik opened this issue Jan 17, 2025 · 0 comments

Comments

@kuba-orlik
Copy link

kuba-orlik commented Jan 17, 2025

When using this simple code:

import { Polly } from '@pollyjs/core';
import { default as XHRAdapter } from '@pollyjs/adapter-xhr';
import FetchAdapter from '@pollyjs/adapter-fetch';
import { default as NodeHTTPAdapter } from '@pollyjs/adapter-node-http';

// Register the xhr adapter so its accessible by all future polly instances
Polly.register(XHRAdapter);
Polly.register(FetchAdapter);
Polly.register(FetchAdapter);

I'm getting the following error:

Argument of type 'typeof import("/my_project/node_modules/@pollyjs/adapter-xhr/types")' is not assignable to parameter of type 'Newable'.\n Type 'typeof import("/my_project/node_modules/@pollyjs/adapter-xhr/types")' provides no match for the signature 'new (...args: any[]): any'.

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

1 participant