# Runtime Error: `(0 , superstruct_1.boolean) is not a function` in browser environment
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react, typescript
調査の方向性
CRACO と記載されている @openzeppelin/merkle-tree 依存関係を使用する Create React App で障害を再現します。まず @metamask/abi-utils/dist/parsers/bool.js と、バンドルに含まれる superstruct.boolean の処理を調査します。ブラウザーアプリケーションがこのランタイムエラーなしで読み込まれ、影響を受けた ABI utilities が引き続き使用できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Following up on this issue https://github.com/ethereum-attestation-service/eas-sdk/issues/125
When using @metamask/abi-utils in a React application (Create React App with CRACO), we encounter a runtime error related the superstruct's boolean function.
Error Details Browser console error:
bundle.js:3328 Uncaught TypeError: (0 , superstruct_1.boolean) is not a function
at ./node_modules/@metamask/abi-utils/dist/parsers/bool.js (bundle.js:3328:76)
at options.factory (bundle.js:167452:30)
at __webpack_require__ (bundle.js:166819:32)
at fn (bundle.js:167080:21)
at hotRequire (bundle.js:167435:47)
at ./node_modules/@metamask/abi-utils/dist/parsers/index.js (bundle.js:3752:14)
at options.factory (bundle.js:167452:30)
at __webpack_require__ (bundle.js:166819:32)
at fn (bundle.js:167080:21)
at hotRequire (bundle.js:167435:47)
Steps to Reproduce
- Create a new React application using Create React App
- Install CRACO:
yarn add @craco/craco - Install
@openzeppelin/merkle-tree(or@ethereum-attestation-service/[email protected]as per this issue https://github.com/ethereum-attestation-service/eas-sdk/issues/125) which depends on@metamask/abi-utils - Add basic CRACO configuration for webpack
- Start the development server:
yarn start - The error appears in the browser console immediately upon loading
Environment
- React version: 18.3.1
- Node.js version: 20.18
- Yarn version: 1.22.17
- Create React App with CRACO
Dependencies
{
"dependencies": {
"@openzeppelin/merkle-tree": "^1.0.8"
}
}
Attempted Solutions
- Added webpack configuration to handle ESM/CommonJS conversion
- Cleared node_modules and yarn cache
- Added specific babel-loader configuration for MetaMask packages
Additional Context
The error occurs specifically in the browser environment and seems to be related to how the superstruct exports are being handled during bundling. The issue appears to be a module resolution problem where the boolean function from is not being properly imported/exported.
Questions
- Is there a recommended way to use
@metamask/abi-utilsin a browser environment? - Are there specific webpack/bundler configurations that should be used?
- Is this a known issue with the package's browser compatibility?
Thank you for your help in resolving this issue.
- 主要言語
- TypeScript
- スター
- 24
- フォーク
- 8
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MetaMask/abi-utils のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
enhancement help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
MetaMask/abi-utils の issue をすべて見る
似ている issue
-
priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
prime-radiant-inc/evener#3291 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto-cli#14961 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
supabase/agent-skills#614 ·
-
Content
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
RunestoneInteractive/rs#1559 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信