Skip to content

Export husky module in project defaulting to ESM requires the .default() property usage  #1362

@jerome-benoit

Description

@jerome-benoit

To reproduce:

  • Create node.js a project defaulting to ESM ("type": "module")
  • Install husky as deps dev
  • Import husky in a prepare.js ESM module and try to run it in the prepare step: import('husky').then(husky => husky()):

TypeError: husky is not a function
at file:///Users/I339261/SAPDevelop/e-mobility-charging-stations-simulator-git/prepare.js:7:33

  • And doing import('husky').then(husky => husky.default()) works

Using the default attribute on husky imported ESM module is not expected.

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