Hey! I have an error when I instantiate PythSolanaReceiver on my Solana tests.
Already I integrate and build successfully Pyth price feed on my Anchor program, but when I instantiate const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet });in TypeScript tests, it fails.
Just for this line fails with wrong errors (because the error say error with a local import that it’s ok, and when I don’t instantiate PythSolanaReceiverI don’t have any error with these files).
Hey, What error do you get?
Just an error like “./file.ts’ is bad imported or it isn’t exist. But this file yes exist and it’s well I’m imported because it’s a file that I created and when I don’t import const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet }); works fine.
Is like if when I import PythSolanaReceiver,it break the rest of imports.
I tried use all of my functions and variables in just one file to avoid import custom files but it still fails.
This is the specific error:Exception during run: Error: Cannot find module ‘/Users/…/tests/utils/constants’ imported from /Users/…/tests/file.test.ts when I import an declare const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet });
But that don’t have sense because when I comment this line all works fine.
I really don’t know what happens here, maybe the versions of my packages, idk.
"dependencies": {
"@coral-xyz/anchor": "^0.32.1",
"@pythnetwork/hermes-client": "^2.1.0",
"@pythnetwork/pyth-solana-receiver": "^0.13.0",
"@solana/spl-token": "^0.4.14"
},
"devDependencies": {
"@types/bn.js": "^5.2.0",
"@types/chai": "^5.2.3",
"@types/mocha": "^10.0.10",
"chai": "^6.2.2",
"mocha": "^11.7.5",
"prettier": "^3.7.4",
"ts-mocha": "^11.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
}
Thanks in advance!
Hey,
The best way for us to look at this is if you make a minimal Github repo that encounters the error. Let us know if you are able to!
Thanks,
Guillermo