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

Could not resolve rpc-websockets/dist/lib/client" when using Solana Web3 in React application #2777

Closed
Ritikchhipa5 opened this issue Jun 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Ritikchhipa5
Copy link

Overview

I am encountering an issue when using the Solana Web3 library in my React application. The application throws an error during the build process.

Expected Behavior

The React application should compile and run without errors, allowing me to interact with the Solana blockchain using the Solana Web3 library.

##Actual Behavior
The application fails to compile and throws the following error:
**Could not resolve rpc-websockets/dist/lib/client**

Screenshot 2024-06-05 at 7 31 45 PM

##package.json file

{
  "name": "",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "relay": "relay-compiler",
    "relay-c": "get-graphql-schema https://sbapi.fitburn.shop/api/graphql > schema.graphql && relay-compiler",
    "watch-relay": "relay-compiler --watch",
    "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^6.5.1",
    "@solana/wallet-adapter-base": "^0.9.23",
    "@solana/wallet-adapter-material-ui": "^0.6.0",
    "@solana/wallet-adapter-react": "^0.15.35",
    "@solana/wallet-adapter-wallets": "^0.19.32",
    "@solana/web3.js": "^0.30.8",
    "@stripe/react-stripe-js": "^2.7.1",
    "@stripe/stripe-js": "^3.4.0",
    "@types/react-image-magnify": "^2.7.4",
    "@types/react-rangeslider": "^2.2.7",
    "axios": "^1.6.8",
    "babel-plugin-relay": "^16.2.0",
    "country-language": "^0.1.7",
    "formik": "^2.4.5",
    "get-graphql-schema": "^2.1.2",
    "graphql": "^16.8.1",
    "i18next": "^23.11.4",
    "i18next-http-backend": "^2.5.1",
    "jwt-decode": "^4.0.0",
    "moment": "^2.30.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-i18next": "^14.1.1",
    "react-image-magnify": "^2.7.4",
    "react-range": "^1.8.14",
    "react-relay": "^16.2.0",
    "react-router-dom": "^6.22.3",
    "react-slick": "^0.30.2",
    "react-toastify": "^10.0.5",
    "relay-runtime": "^16.2.0",
    "remixicon": "^4.2.0",
    "rpc-websockets": "^7.11.0",
    "slick-carousel": "^1.8.1",
    "tailwind-scrollbar-hide": "^1.1.7",
    "uuid": "^9.0.1",
    "vite-plugin-env-compatible": "^2.0.1",
    "vite-plugin-relay": "^2.1.0",
    "yup": "^1.4.0"
  },
  "devDependencies": {
    "@types/react": "^18.2.66",
    "@types/react-dom": "^18.2.22",
    "@types/react-relay": "^16.0.6",
    "@types/react-slick": "^0.23.13",
    "@types/relay-runtime": "^14.1.23",
    "@types/uuid": "^9.0.8",
    "@typescript-eslint/eslint-plugin": "^7.2.0",
    "@typescript-eslint/parser": "^7.2.0",
    "@vitejs/plugin-react": "^4.2.1",
    "autoprefixer": "^10.4.19",
    "eslint": "^8.57.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.6",
    "postcss": "^8.4.38",
    "relay-compiler": "^16.2.0",
    "tailwindcss": "^3.4.3",
    "typescript": "^5.2.2",
    "vite": "^5.2.0"
  }
}
@Ritikchhipa5 Ritikchhipa5 added the bug Something isn't working label Jun 5, 2024
@steveluscher
Copy link
Collaborator

Fixed in #2758. Upgrade to 1.91.9.

Copy link
Contributor

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants