Infura taking too long to create contract

I am trying to deploy a smart contract (compiled and tested in local ganache network).
When I run this code I am not getting any output for a long time, response is jibrish sometimes. Bytecode is preceded with “0x” and project ID and passphrase(from metamask) are correct

Here is the javascript code:

const HDWalletProvider = require("@truffle/hdwallet-provider");
const Web3 = require("web3");
const { bytecode, interface } = require("./compile");
const config = require("./config.json");

const provider = new HDWalletProvider(config.mnemonic, config.url);
const web3 = new Web3(provider);

const deploy = async () => {
  const accounts = await web3.eth.getAccounts();
  const response = await new web3.eth.Contract(interface)
      data: bytecode,
      arguments: ["hello from adithya"],
    .send({ from: accounts[0], gas: "10000000" });
  console.log("Contract deployed to ", response.options.address);


Hey @adithyabhat99 , what is the gibberish response you are getting?

Can I recommend you try out using ethers.js to deploy the contract? The steps to do that are described here:

Another great product that helps with deploys is Truffle or Waffle, let me know if you want links to guides for those.

The gibberish response that I was getting is resolved, the issue here is infura doesn’t seem to deploy the contract or send any error messages.
I will surely try ethers.js
But I am used to web3 and it has already worked well until now for me.

Glad that you got one thing resolved.

What Infura URL are you using for the connection? Also, for deploying to a testnet or mainnet, you’ll need ether in an account to pay for gas. Getting your code to use the correct account can be tricky, can you doublecheck the metamask account you’re using has ether?

Thank you for your support.
I resolved the issue by switching to Ropsten network.