Skip to content

Built sol-wallet-adapter still includes import statements #38

@ebramanti

Description

@ebramanti

When this package is built into a CommonJS file, it still contains ES6 imports. From the latest version (0.2.4), the following lines will cause runners such as Jest (which assume node_modules as built CommonJS) to break:

import EventEmitter from 'eventemitter3';
import { PublicKey } from '@solana/web3.js';
import bs58 from 'bs58';

In the meantime, a workaround for anyone experiencing this is to add the following to your Jest configuration:

    "transform": {
      "(@project-serum/sol-wallet-adapter).+\\.js$": "babel-jest"
    },
    "transformIgnorePatterns": [
      "/node_modules/(?!@project-serum/sol-wallet-adapter)"
    ]

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