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

undici/types/index.d.ts:21:8: Type error TS1192: Module '"undici@6.19.0/node_modules/undici/types/interceptors"' has no default export #3330

Closed
btakita opened this issue Jun 14, 2024 · 6 comments · Fixed by #3332
Labels
bug Something isn't working

Comments

@btakita
Copy link

btakita commented Jun 14, 2024

Bug Description

After upgrading to v6.19.0. When running the check-dts program to verify the types. The following error occurs:

undici/types/index.d.ts:21:8: Type error TS1192
│   Module '"undici@6.19.0/node_modules/undici/types/interceptors"' has no default export

Reproducible By

Running check-dts

Expected Behavior

No Type error

Logs & Screenshots

Environment

Linux 6.9.4-arch1-1 x86_64 unknown

Node v22.3.0

Additional context

Here is the line causing the error: https://github.com/nodejs/undici/blob/main/types/index.d.ts#L21

Came from #3318

@btakita btakita added the bug Something isn't working label Jun 14, 2024
@mcollina
Copy link
Member

Can you create a quick reproduction that we can run?

@mcollina
Copy link
Member

(A PR with the fix is also fine)

@metcoder95
Copy link
Member

True, it has not default export; completely missed that, but wonder how the test passed:

export type DumpInterceptorOpts = { maxSize?: number }
export type RetryInterceptorOpts = RetryHandler.RetryOptions
export type RedirectInterceptorOpts = { maxRedirections?: number }
export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export declare function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export declare function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export declare function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor

@btakita
Copy link
Author

btakita commented Jun 14, 2024

@metcoder95 I use the check-dts package to verify the types. Typescript acts unpredictably at times with type verifications. At times, I have seen types fail in a dependent package's tests.

Perhaps importing some types in a *.test.ts module would help?

@metcoder95
Copy link
Member

It could be useful sure, do you want to send a PR for it?

@Uzlopak
Copy link
Contributor

Uzlopak commented Jun 17, 2024

provided PR #3332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants