developer-content icon indicating copy to clipboard operation
developer-content copied to clipboard

Error when executing "How to Sign and Verify a Message" example

Open TheGP opened this issue 1 year ago • 0 comments

Error when executing https://solana.com/developers/cookbook/wallets/sign-message

/index.js:2
	generateKeyPair,
	^^^^^^^^^^^^^^^
SyntaxError: Named export 'generateKeyPair' not found. The requested module '@solana/web3.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@solana/web3.js';

TheGP avatar Jan 05 '25 14:01 TheGP