getLatestBlockInfo timeout when accessing test node


I am trying to use Casper JS SDK with Chrome Casper Signer plugin to access a test node from my web server. I have nodejs set up and running and connecting nicely with the Casper Signer Chrome plugin (I had to request to be added to the plugin whitelist). When I try to retrieve the latest block info, using the Casper JS SDK, I get a timeout. I am trying to follow the instructions outlined here:

My code looks like this. I have put a comment above the line that is causing the timeout:

import * as casper from "";

//Create Casper client and service to interact with Casper node.
const apiUrl = '';
const casperService = new CasperServiceByJsonRPC(apiUrl);
const casperClient = new CasperClient(apiUrl);

const btnConnect = document.getElementById("btnConnect");
btnConnect.addEventListener("click", async () => {
    await AccountInformation();

const btnDisconnect = document.getElementById("btnDisconnect");
btnDisconnect.addEventListener("click", () => {

async function AccountInformation(){
        const isConnected = await window.casperlabsHelper.isConnected()
                const publicKey = await window.casperlabsHelper.getActivePublicKey();
                textAddress.textContent += publicKey;

// ****** THIS CALL FAILS WITH A TIMEOUT *****************
                const latestBlock = await casperService.getLatestBlockInfo();

                const root = await casperService.getStateRootHash(latestBlock.block.hash);

                const balanceUref = await casperService.getAccountBalanceUrefByPublicKey(

                //account balance from the last block
                const balance = await casperService.getAccountBalance(
                textBalance.textContent = `PublicKeyHex ${balance.toString()}`;

Many thanks for your help!


My Git repository can be found here: GitHub - adrianj74/nodejs_signer

I have fixed this issue. The first problem was that I was using a test node that was incorrect!! I used a valid on and the timeout went away. Then I got a CORS error. This was fixed using a proxy server to handle a javascript request to get the balance, which then called the casper sdk.