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

"Given address is not a PublicKey nor a string" with react build #1205

Closed
alchemistgo87 opened this issue Dec 29, 2021 · 1 comment
Closed

Comments

@alchemistgo87
Copy link

Getting this error while creating a new Program object:

Uncaught Error: Given address is not a PublicKey nor a string.
    at an (common.ts:64)
    at new e (index.ts:253)
    at WorkspaceProvider.jsx:27
    at Object.useMemo (react-dom.production.min.js:172)
    at t.useMemo (react.production.min.js:23)
    at N (WorkspaceProvider.jsx:23)
    at oo (react-dom.production.min.js:157)
    at Zu (react-dom.production.min.js:267)
    at Is (react-dom.production.min.js:250)
    at js (react-dom.production.min.js:250)

I am getting this strange issue only while running the build (with yarn build & serve -s build), though it is working fine locally (with yarn start)

Here is the link to my repo:
https://github.com/alchemistgo87/solana-react-twitter

Here is the specific file in which I am creating the program object:
https://github.com/alchemistgo87/solana-react-twitter/blob/main/app/src/hooks/WorkspaceProvider.jsx

@alchemistgo87
Copy link
Author

Found the solution:
There was a bug in anchor version 0.19.0 (Ref - #1138 ) which is now fixed in 0.19.1-beta.1

So, I just needed to upgrade the anchor library version:

yarn upgrade @project-serum/anchor --latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant