Skip to content

[BUG] Importing in TS project does not work #13

Description

@josemgarcia

Trying to import the module using:

import oasTelemetry from '@oas-tools/oas-telemetry';

Gives the following error when compiling:

error TS1192: Module '"route/to/my/project/node_modules/.pnpm/@oas-tools+oas-telemetry@0.7.1/node_modules/@oas-tools/oas-telemetry/dist/types/index"' has no default export.

In order to solve this issue, apparently, the type definition must explicitly state that oasTelemetry is the default export. Thus, modifying line 10 at https://github.com/oas-tools/oas-telemetry/blob/67011a99fb71f442848142f2fb8e33382ba8f8e5/packages/lib/src/types/cjs-index.d.ts using

export default oasTelemetry;

solved the issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions