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

Module parse failed: Unexpected token walletconnect-v2 #902

Open
MHarisAshfaq opened this issue Nov 28, 2023 · 1 comment
Open

Module parse failed: Unexpected token walletconnect-v2 #902

MHarisAshfaq opened this issue Nov 28, 2023 · 1 comment

Comments

@MHarisAshfaq
Copy link

MHarisAshfaq commented Nov 28, 2023

Node Version is v14.21.2

This is my package.json file:

  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^13.0.0",
    "@testing-library/user-event": "^13.2.1",
    "@types/jest": "^27.0.1",
    "@types/node": "^16.7.13",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "@web3-react/core": "^8.2.3",
    "@web3-react/types": "^8.2.3",
    "@web3-react/walletconnect-v2": "^8.5.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "typescript": "^4.4.2",
    "web-vitals": "^2.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts 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"
    ]
  }
}

And this is the error I am facing

Failed to compile.

./node_modules/@walletconnect/ethereum-provider/dist/index.es.js 55:10
Module parse failed: Unexpected token (55:10)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|       } : {})
|     },
>     r = e?.filter(l => !m.includes(l)),
|     d = i?.filter(l => !u.includes(l));
|   if (!s && !h && !n && !(r != null && r.length) && !(d != null && d.length)) return {

This error show up when I run npm/yarn start

@Johnathon332
Copy link

I see that you are using Create React App, I ended up using Craco and added the appropriate babel loaders such as optional chaining and null coalescing.

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

2 participants