Skip to content

Missing esm dirs cause build error #5

@cherealnice

Description

@cherealnice

Hi!

I was trying out Vite and I got this error when building:
Failed to resolve entry for package "@mathdoy/toggle". The package may have incorrect main/module/exports specified in its package.json

After some digging it seems like the module setting in package.json is set to:
"module": "esm/toggle.js",

After running npm i, these esm directories do not exist which is causing this error. Removing the module field resolves the issue.

Happy to open a PR, just wasn't sure what the best path forward is for this, one solution is to nuke the module fields, another is to build esm and include them into the packages.

versions:
@mathdoy/toggle: 1.1.0
@mathody/toggle-react: 1.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions