Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

300
Visualizações
× Error: Alchemy URL protocol must be one of http, https, ws, or wss. Recieved: undefined React.js

I just clone smart contract react application in VS code and installed node modules. When i try to npm start, it gave me the error " Error: Alchemy URL protocol must be one of http, https, ws, or wss. Recieved: undefined React.js".

How can i solve this problem? Thanks

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

According to the Alchemy documentation,

using websockets with the web3-alchemy sdk requires setting up your web3 object with a websocket URL, like this:

const { createAlchemyWeb3 } = require("@alch/alchemy-web3");

const web3 = createAlchemyWeb3("wss://eth-mainnet.ws.alchemyapi.io/ws/<api-key>");

when it is set up correctly, you should be able to make a call, for example:

web3.eth.getBlockNumber().then(console.log);  // -> 7946893

The error you are seeing is due to an incorrect argument undefined React.js being passed into the alchemy web3 instantiation, basically:

const web3 = createAlchemyWeb3( undefined React.js ); // the error is here

You need to figure out why there is an undefined React.js showing up, and once you fix that error, your app should be able to load!

about 4 years ago · Juan Pablo Isaza Relatório

0

Not exactly sure but check your package.json file and see the version of react-scripts. If it defines an older version, try updating to the latest with :

npm uninstall react-scripts or yarn remove react-scripts

and re-install using

yarn add react-scripts or npm add react-scripts.

about 4 years ago · Juan Pablo Isaza Relatório

0

So in my case the problem was that in the code where you call for the json file from artifacts has to be named properly because in my case the name of the file was different so make sure that is not the case with you.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda