Chain: Solana mainnet
Timestamp: August 4, 2025 – 19:24 IST (13:54 UTC)
Steps to Reproduce:
-
Set up a Solana TypeScript test project using Pyth SDKs.
-
Install
@pythnetwork/pyth-solana-receiver. -
Try running a test file using
ts-mocha.
When executing a test that imports PythSolanaReceiver, we encounter the following error:
Error: Package subpath './dist/lib/client' is not defined by "exports" in /node_modules/rpc-websockets/package.json
This seems to originate from a transitive dependency inside @pythnetwork/solana-utils, which in turn is used by pyth-solana-receiver.
Relevant Code Snippet:
import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
async function getPriceFeedAccount(feedId: string, connection: Connection, wallet: Keypair): Promise<PublicKey> {
try {
// Create PythSolanaReceiver instance
const pythSolanaReceiver = new PythSolanaReceiver({
connection,
wallet: wallet as any
});
// Get the price feed account address using shard 0
const priceFeedAccountAddress = pythSolanaReceiver
.getPriceFeedAccountAddress(0, feedId)
.toBase58();
const priceFeedAccount = new PublicKey(priceFeedAccountAddress);
console.log("Pyth SDK - Price feed account:", priceFeedAccount.toString());
console.log("Feed ID:", feedId);
// Check if the account exists
const accountInfo = await connection.getAccountInfo(priceFeedAccount);
if (!accountInfo) {
console.warn(`Warning: Price feed account ${priceFeedAccount.toString()} does not exist on the blockchain.`);
console.warn("This might cause issues if the account is required for the transaction.");
} else {
console.log("Price feed account exists and has size:", accountInfo.data.length);
}
return priceFeedAccount;
} catch (error) {
console.error("Error getting price feed account:", error);
throw error;
}
}
Issue Summary:
- Root cause appears to be related to
rpc-websocketsusage within the Pyth packages (possibly insidejito-tsor@pythnetwork/solana-utils).
Any help resolving this issue or understanding the required setup would be appreciated. ![]()