0

I deployed successfully my first app (AssemblyScript + Reactjs), but when i test on github-pages, i got this error.

errors.js:18 Uncaught (in promise) Error: [-32000] Server error: account xxx.testnet does not exist while viewing
at json-rpc-provider.js:322
at async Object.e [as default] (exponential-backoff.js:7)
at async y.sendJsonRpc (json-rpc-provider.js:297)
at async y.query (json-rpc-provider.js:109)
at async _.viewFunction (account.js:366)

I test method contract with near-cli and it's ok, so i don't understand why web not work. Thanks you all.

testnet does not exist while viewing

1 Answers1

0

If you deploy contract to testnet server (accountId be like xxx.testnet), you should remove process.env.NODE_ENV at src/utils.js:

const nearConfig = getConfig("development");

because When you run npm start, process.env.NODE_ENV is always equal to 'development', when you run npm test it is always equal to 'test', and when you run npm run build to make a production bundle, it is always equal to 'production'. So if nearConfig is production config, all url are mainnet server, not testnet server that you deployed your contract!