anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.46k stars 911 forks source link

Phantom signTransaction not defined #817

Closed bhgames closed 11 months ago

bhgames commented 11 months ago

Describe the bug A clear and concise description of what the bug is.

Sporadically, phantom becomes disconnected from the window. It's still defined (window.phantom) but the signTransaction method is now undefined from useWallet() and in other places.

To Reproduce Steps to reproduce the behavior:

Not really possible to reproduce it. It happens sporadically. However, here is my package.json:

{ "name": "asdasda", "version": "2.1.0", "description": "", "main": "index.js", "scripts": { "build": "webpack --config webpack-dist.config.js", "start": "webpack serve", "lint": "eslint . --ext .js --ext .ts" }, "author": "sdsdasd", "license": "ISC", "devDependencies": { "@types/easystarjs": "^0.3.1", "@types/node": "^20.4.1", "@typescript-eslint/eslint-plugin": "^5.4.0", "@typescript-eslint/parser": "^5.4.0", "copy-webpack-plugin": "^10.0.0", "css-loader": "^6.8.1", "eslint": "^8.2.0", "eslint-config-google": "^0.14.0", "phaser-import-pipeline": "^3.0.0", "prettier": "^2.8.8", "style-loader": "^3.3.3", "ts-loader": "^9.4.2", "typescript": "^5.0.4", "webpack": "^5.64.2", "webpack-cli": "^4.9.1", "webpack-dev-server": "^4.5.0" }, "resolutions": { "@solana/wallet-standard-wallet-adapter-base": "1.0.1" }, "dependencies": { "@project-serum/anchor": "^0.26.0", "@solana/spl-token": "^0.3.8", "@solana/wallet-adapter-base": "^0.9.22", "@solana/wallet-adapter-react": "^0.15.32", "@solana/wallet-adapter-react-ui": "^0.9.31", "@solana/wallet-adapter-wallets": "^0.19.17", "@solana/web3.js": "^1.77.3", "@types/react": "^18.2.14", "array-flat-polyfill": "^1.0.1", "browserify-zlib": "^0.2.0", "crypto-browserify": "^3.12.0", "dotenv": "^16.0.3", "easystarjs": "^0.4.4", "heap-js": "^2.2.0", "https-browserify": "^1.0.0", "immutable": "^4.3.0", "jsonrepair": "^3.2.0", "langchain": "^0.0.96", "node-fetch": "^3.3.1", "openai": "^3.3.0", "pg": "^8.11.0", "phaser": "^3.55.2", "phaser3-rex-plugins": "^1.60.2", "react": "^18.2.0", "react-modal": "^3.16.1", "sharp": "^0.32.2", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "typescript-eslint": "^0.0.1-alpha.0", "url": "^0.11.1", "zod": "^3.21.4" } }

Expected behavior signTransaction to always be there.

Screenshots

image

Desktop (please complete the following information):

bhgames commented 11 months ago

Lockfile: https://gist.github.com/bhgames/e33684e095003856f99be4862bc49c0e

bhgames commented 11 months ago

So, checked window, and it's saying isConnected is false:

image

So what's interesting is I do have the users connect via the select wallet button. I think this might be a case of some session timer running dry or something. Gonna verify this, don't look into it until I get back to you to save you time.

jordaaash commented 11 months ago

Just linking origin tweet for future context: https://twitter.com/redacted_j/status/1689027265869299712

kolpav commented 11 months ago

@jordansexton Do you still have the tweet please?

bhgames commented 11 months ago

I deleted it because I didn't want to cause any panic.