Skip to content

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

Description

@btakita

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

Activity

  1. mcollina commented on Jun 14, 2024

    @mcollina
    SponsorMember

    Can you create a quick reproduction that we can run?

  2. mcollina commented on Jun 14, 2024

    @mcollina
    SponsorMember

    (A PR with the fix is also fine)

  3. metcoder95 commented on Jun 14, 2024

    @metcoder95
    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

  4. btakita commented on Jun 14, 2024

    @btakita
    Author

    @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?

  5. metcoder95 commented on Jun 16, 2024

    @metcoder95
    Member

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

  6. Uzlopak commented on Jun 17, 2024

    @Uzlopak
    Contributor

    provided PR #3332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions