Skip to content

8.0.0 fails to use esm in node #144

Description

@hugomrdias

the dual packaging setup does not support esm version in node and cjs version does not do named exports correctly

import { getBIP44AddressKeyDeriver } from '@metamask/key-tree';
         ^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'getBIP44AddressKeyDeriver' not found. The requested module '@metamask/key-tree' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@metamask/key-tree';
const { getBIP44AddressKeyDeriver } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

More information about dual packaging here https://github.com/sheremet-va/dual-packaging.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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