MetaMask / eth-block-tracker

A JS module for keeping track of the latest Ethereum block by polling an ethereum provider
MIT License
132 stars 81 forks source link

Compile error using craco in react app for eth-block-tracker #148

Closed Cally99 closed 8 months ago

Cally99 commented 1 year ago

The is the following error I got. I've tried every trick under the sun and I can't get it to compile. There seems to to be a compatibility or resolution issue between these packages. Especially the latest ones.

Does anyone have working versions? in package.json for metamask/utils eth-block-tracker and @coinbase/wallet-sdk

Failed to compile.

./node_modules/@coinbase/wallet-sdk/node_modules/eth-block-tracker/dist/logging-utils.js
Module not found: Can't resolve '@metamask/utils' in '/Users/mac/Documents/LiquidCrypto/landing-cms/landing/node_modules/@coinbase/wallet-sdk/node_modules/eth-block-tracker/dist'

This is my package.json


{
  "name": "crosswise_landing_v2",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@apollo/client": "^3.4.16",
    "@apollo/react-hooks": "^4.0.0",
    "@binance-chain/bsc-connector": "^1.0.0",
    "@coinbase/wallet-sdk": "^3.6.6",
    "@craco/craco": "^6.4.4",
    "@emotion/react": "^11.10.4",
    "@emotion/styled": "^11.10.4",
    "@ethersproject/providers": "5.5.2",
    "@metamask/eth-sig-util": "^5.1.0",
    "@metamask/utils": "^4.0.0",
    "@mui/icons-material": "^5.10.3",
    "@mui/material": "^5.10.5",
    "@reduxjs/toolkit": "^1.9.5",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@transak/transak-sdk": "^1.3.0",
    "@web3-react/core": "6.1.9",
    "@web3-react/fortmatic-connector": "^6.1.6",
    "@web3-react/injected-connector": "^6.0.7",
    "@web3-react/portis-connector": "^6.2.11",
    "@web3-react/walletconnect-connector": "6.2.4",
    "@web3-react/walletlink-connector": "^6.2.14",
    "apollo-boost": "^0.4.9",
    "axios": "^0.27.2",
    "eth-block-tracker": "^7.0.1",
    "graphql": "^15.8.0",
    "immer": "^10.0.1",
    "moment": "^2.29.4",
    "react": "^17.0.2",
    "react-copy-to-clipboard": "^5.1.0",
    "react-csv": "^2.2.2",
    "react-dom": "^17.0.2",
    "react-ga": "^3.3.1",
    "react-redux": "^8.0.5",
    "react-router-dom": "^6.3.0",
    "react-scripts": "4.0.3",
    "typescript": "^4.8.3",
    "web-vitals": "^1.0.1",
    "web3": "^1.8.0"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "autoprefixer": "^9.8.8",
    "postcss": "^7.0.39",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17"
  }
}
mcmire commented 1 year ago

Hi @Cally99, sorry you're having this issue. Did the compilation error occur after you added some code or after installing one of those packages?

mcmire commented 8 months ago

Closing this issue as it's been open for a while and this might have been solved now.