Skip to content

Friendly note on unexpected side-effects of 2.1.5->2.1.6 transition #21

@ukstv

Description

@ukstv

Using marvellous uint8arrays library extensively. The recent change depends on multiformats module instead of previous multibase. Apparently, multiformats uses conditional exports in its package.json, and vanilla Jest can not handle those.

So, if some people start complaining on their tests failing with cryptic errors, like Cannot read property 'base16' of undefined, please know, this is due to Jest unable to load multiformats properly.

A solution I have for the downstream users is to use custom resolver for Jest (jest-resolver-enhanced), like in the following fragment of package.json:

{
  "jest": {
    "resolver": "jest-resolver-enhanced"
  },
}

Any other resolver capable of handling conditional exports is just as fine, but every one I know of, are unusable right now due to old age. Checked them all, IMO.

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