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
v6.0.0 to v6.0.1 introduces TypeScript type incompatibilities #433
Comments
I just realized that the types come from:
And that PollyJS is a JS project. Feel free to close this issue if you feel that this should be handled elsewhere. I'm leaving it open for now in case others come across this when trying to upgrade and may be able to help provide direction here. |
I ran into the same problem. I ended up doing the following as a workaround. import Adapter from '@pollyjs/adapter';
import Persister from '@pollyjs/persister';
import NodeHttpAdapter from '@pollyjs/adapter-node-http';
import FSPersister from '@pollyjs/persister-fs';
Polly.register(NodeHttpAdapter as typeof Adapter);
Polly.register(FSPersister as typeof Persister); It was not clear to me why it was necessary. |
It seems that the types are now located in the subrepos instead of DefinitelyTyped. Why they are incorrect I'm not sure, but import Adapter from '@pollyjs/adapter';
import { Request } from '@pollyjs/core';
export default class NodeHttpAdapter<
TOptions extends {} = {},
TRequest extends Request = Request
> extends Adapter<TOptions, TRequest> {} and import Persister from '@pollyjs/persister';
export default class FSPersister<
TOptions extends {
recordingsDir?: string;
} = {}
> extends Persister<TOptions> {} |
Can you give |
Thanks for looking at this. Moved on to some new errors: node_modules/@pollyjs/core/types.d.ts:108:3 - error TS7010: 'constructor', which lacks return-type annotation, implicitly has an 'any' return type.
108 constructor(
~~~~~~~~~~~~
109 polly: Polly,
~~~~~~~~~~~~~~~~~
...
116 }
~~~~~
117 );
~~~~
node_modules/@pollyjs/persister/types.d.ts:2:24 - error TS7016: Could not find a declaration file for module 'set-cookie-parser'. '/<my-repo-redacated>/node_modules/set-cookie-parser/lib/set-cookie.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/set-cookie-parser` if it exists or add a new declaration (.d.ts) file containing `declare module 'set-cookie-parser';`
2 import { Cookie } from 'set-cookie-parser';
~~~~~~~~~~~~~~~~~~~
Found 2 errors. |
@guyellis apologies for the back and forth. Can you give |
@offirgolan - yes that worked - thank you! 🥇 |
Description
In this change: v6.0.0...v6.0.1
The
NodeHttpAdapter
andFSPersister
types are no longer compatible.Error Message & Stack Trace
Environment
The text was updated successfully, but these errors were encountered: