Skip to content

Consider fixing types to prevent erros when installing the package in an ESM project #1769

Open
@TomasHubelbauer

Description

@TomasHubelbauer

Hi, I am trying to use your project through https://www.npmjs.com/package/eufy-security-client which relies on it. I set up a new Vite project using npm create vite@latest my-react-app -- --template react and installed the package but when I run npm run build, I run into an error which says:

Failed to resolve entry for package "mqtt". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]

I believe this might be caused by incorrectly configured types. I checked your package using https://arethetypeswrong.github.io/?p=mqtt%405.3.4 and this is the result:

image

I am not a 100 % certain, but I believe the errors reported there might be what's causing the above issue.

I wonder if these could be fixed to make the package compatible with both CJS and ESM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions