Web3Api.initialize failed: initialize with apiKey or serverUrl error

Not sure why it stopped working but it was working a couple days ago.

var Web3 = require('web3');
const Moralis  = require('moralis/node');
const ethers = require('ethers');
const options = {
    // Enable auto reconnection
    reconnect: {
    auto: true,
    delay: 5000, // ms
    maxAttempts: 5,
    onTimeout: false

var web3 = new Web3(
new Web3.providers.WebsocketProvider(
    "speedynode url",
const serverUrl = "moralis_serverurl";
const appId = "app_id";
Moralis.start({ serverUrl, appId });
async function init(){ //this function is where it goes wrong
    let query = new Moralis.Query('PairCreatedEvents');
    let subscription = await query.subscribe();
    subscription.on('create', pair_created);
    subscription.on('open', () => {
         console.log('subscription opened');
    subscription.on('close', () => {
            console.log('subscription closed');

the Exact error:

C:\Users\Do Yugen\Desktop\TestBot\Node\node_modules\moralis\lib\node\MoralisWeb3Api.js:37
      throw new Error('Web3Api.initialize failed: initialize with apiKey or serverUrl');

Error: Web3Api.initialize failed: initialize with apiKey or serverUrl
    at Function.initialize (C:\Users\Do 
    at Function.start (C:\Users\Do 
    at Object.<anonymous> (C:\Users\Do Yugen\Desktop\TestBot\Node\app.js:42:9)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Not sure where something has changed

you could move that Moralis.start in init and use await

what version of Moralis SDK are you using? (Moralis.CoreManager.get("VERSION"))

added await Moralis.start({serverURL, appid});
still same error.

Version is: Moralis version : js0.0.143

also getting this as warning: Moralis.start warning: to use web3 access, moralisSecret is required

not sure where I would add this?

example that works: [SOLVED] Aggregate call requires masterKey

you can ignore that moralisSecret part

maybe serverUrl and appId are not the right ones

Okay awesome, will update and let you know

Still the same error. double checked the details and added masterkey. The only real difference is that on my moralis server dashboard (of which I have two, one for FTM and one for BSC) the network for FTM server is not 0 where the BSC server says network is 0 bytes. (FTM server 13.5 mb).
Connecting to the FTM server is no problem, the bsc server connection is where I’m having this problem.

what is that server url?


I can connect to this server from nodejs without problems, you could double check server name and app id