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

fix: WalletConnect commonjs support. #1107

Merged
merged 1 commit into from
May 30, 2024

Conversation

paouvrard
Copy link
Member

Description

Fix commonjs build error when using wallet-connect package:

var modal = require('@walletconnect/modal');
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/pa/aurora-is-near/rainbow-bridge-next/node_modules/@near-wallet-selector/wallet-connect/node_modules/@walletconnect/modal/dist/index.js from /Users/pa/aurora-is-near/rainbow-bridge-next/node_modules/@near-wallet-selector/wallet-connect/index.cjs not supported.
Instead change the require of index.js in /Users/pa/aurora-is-near/rainbow-bridge-next/node_modules/@near-wallet-selector/wallet-connect/index.cjs to a dynamic import() which is available in all CommonJS modules.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Type of change.

  • FIX - a PR of this type patches a bug.
  • FEATURE - a PR of this type introduces a new feature.
  • BUILD - a PR of this type introduces build changes.
  • CI - a PR of this type introduces CI changes.
  • DOCS - a PR of this type introduces DOCS improvement.
  • STYLE - a PR of this type introduces style changes.
  • REFACTOR - a PR of this type introduces refactoring.
  • PERFORMANCE - a PR of this type introduces performance changes.
  • TEST - a PR of this type adds more tests.
  • CHORE - a PR introduces other changes than the specified above.

@paouvrard paouvrard changed the base branch from main to dev May 30, 2024 04:08
Copy link

@Patrick1904 Patrick1904 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vikpande
Copy link

@paouvrard , good to go.

@ewiner ewiner merged commit 87e0487 into near:dev May 30, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

4 participants