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

Cannot run generateKeyPair from @solana/web3.js@rc #3208

Closed
mehranhydary opened this issue Sep 5, 2024 · 5 comments
Closed

Cannot run generateKeyPair from @solana/web3.js@rc #3208

mehranhydary opened this issue Sep 5, 2024 · 5 comments
Labels
bug Something isn't working question Add this to close an issue with instructions on how to repost as a question on Stack Exchange

Comments

@mehranhydary
Copy link

Overview

I am trying to run the command const keyPair: CryptoKeyPair = await generateKeyPair() and I get the following error:

throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED);

Steps to reproduce

I've created a new node js app. I've installed the following:

	"dependencies": {
		"@solana/web3.js": "^2.0.0-rc.0",
		"buffer": "^6.0.3",
		"chalk": "4.1.2",
		"decimal.js": "^10.4.3",
		"dotenv": "^16.4.5",
		"viem": "^2.20.1"
	},
	"devDependencies": {
		"@types/bn.js": "^5.1.0",
		"@types/chai": "^4.3.0",
		"@types/mocha": "^9.0.0",
		"chai": "^4.3.4",
		"mocha": "^9.0.3",
		"prettier": "^2.6.2",
		"ts-mocha": "^10.0.0",
		"ts-node": "^10.9.1",
		"tsconfig-paths": "^4.1.2",
		"typescript": "^5.5.4"
	}

and then I have a simple file

;(async() => {
  const keyPair: CryptoKeyPair = await generateKeyPair();
})()

Description of bug

Here are a few more details from the error:

/Users/mehrancastle/Desktop/dev/personal/controller-lite/node_modules/@solana/assertions/src/subtle-crypto.ts:49
        throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED);
              ^
SolanaError: No key generation implementation could be found.
    at Object.assertKeyGenerationIsAvailable (/Users/mehrancastle/Desktop/dev/personal/controller-lite/node_modules/@solana/assertions/src/subtle-crypto.ts:49:15)
    at generateKeyPair (/Users/mehrancastle/Desktop/dev/personal/controller-lite/node_modules/@solana/keys/src/key-pair.ts:14:11)
    at /Users/mehrancastle/Desktop/dev/personal/controller-lite/lib/controller/raw/index.ts:105:54
    at Object.<anonymous> (/Users/mehrancastle/Desktop/dev/personal/controller-lite/lib/controller/raw/index.ts:130:3)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module.m._compile (/Users/mehrancastle/.config/yarn/global/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/mehrancastle/.config/yarn/global/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12) {
  cause: undefined,
  context: { __code: 3610004 }
}
@mehranhydary mehranhydary added the bug Something isn't working label Sep 5, 2024
@steveluscher steveluscher added the question Add this to close an issue with instructions on how to repost as a question on Stack Exchange label Sep 5, 2024
Copy link
Contributor

github-actions bot commented Sep 5, 2024

Hi @mehranhydary,

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of the Solana JavaScript SDK itself.

Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with the Solana JavaScript SDK itself, please post your question to the Solana Stack Exchange using this link: https://solana.stackexchange.com/questions/ask


This automated message is a result of having added the ‘question’ tag.

@github-actions github-actions bot closed this as completed Sep 5, 2024
@steveluscher
Copy link
Collaborator

Throw this question up on the Stack Exchange, post a link to it here, and I'll answer it! That way, the answer will continue to benefit others once we've moved on.

@mehranhydary
Copy link
Author

Sg! Ty

@mehranhydary
Copy link
Author

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 Sep 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 question Add this to close an issue with instructions on how to repost as a question on Stack Exchange
Projects
None yet
Development

No branches or pull requests

2 participants