SendSignedTransaction Returned error: invalid sender

I try to create interaction with smart-contract through back-end.
I wrote this script from the tutorial: click me.
Tell me please, why I get an error from sending my signed transaction? And how can I fix it?

const Web3 = require('web3');
const Tx = require('@ethereumjs/tx').Transaction;

const MyContract = require('./build/contracts/HelloWorld.json');
const address = '0xD7cE788A5bA84b53932780DfCf98F7430ce5d3e1';
const private_key = process.env.PRIVATE_KEY;
const infuraUrl = process.env.INFURA_URL;

const init = async () => {
    var web3 = new Web3(new Web3.providers.HttpProvider(infuraUrl));
    const networkId = await;

    const myContract = new web3.eth.Contract(

    const tx = myContract.methods.update("LoremIpsum");
    const gas = await tx.estimateGas({from: address});
    const gasPrice = await web3.eth.getGasPrice();
    const data = tx.encodeABI();
    const nonce = await web3.eth.getTransactionCount(address);
    const signedTx = await web3.eth.accounts.signTransaction(
            to: myContract.options.address,
            chain: networkId,
            hardfork: 'newRule'
    ).catch(e => e.message);
    console.log(`Old data value ${await myContract.methods.message().call()}`);
    const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction).catch(e => e.message); //error
    console.log(`Transaction hash ${receipt}`);
    console.log(`New data value ${await myContract.methods.message().call()}`);


Hi @Iangyl and welcome to the Infura community!

From the first look it seems that you are missing ‘from’ address, was that intentional?

A similar issue was brought up here and here, please check those out as well.

Do you have a full error response?

Unfortunately, It didn’t help. Also after I added ‘from’ address the error was changed.
Here is full message i represent like text and picture:

/////////// error
(node:17956) UnhandledPromiseRejectionWarning: Error: Invalid JSON RPC response: “”
at Object.InvalidResponse (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\web3-core-helpers\lib\errors.js:43:16)
at XMLHttpRequest.request.onreadystatechange (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\web3-providers-http\lib\index.js:95:32)
at XMLHttpRequestEventTarget.dispatchEvent (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpRequestError (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\xhr2-cookies\dist\xml-http-request.js:349:14)
at ClientRequest. (D:\Lenovo\IT\Work\CIDT-back-smart-contractP4\node_modules\xhr2-cookies\dist\xml-http-request.js:252:61)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:17956) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see (rejection id: 1)
(node:17956) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/////////// error