Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ebramanti opened this issue Jun 24, 2021 · 0 comments
Open

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

ebramanti opened this issue Jun 24, 2021 · 0 comments

Comments

@ebramanti
Copy link

ebramanti commented Jun 24, 2021

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)"
    ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant