is there a limit on how many pinmodes you can use

i have a sketch that i have added 4 pinmodes to light leds,this has wifi and firebase and works well until i put the 4th pinmode in void setup ,if i put first 3 in setup wifi works ,if i put the forth in wifi has a checksum error ,is there a limit to how many you can add
nodemcu is been used can add code if required

No, you can have as many pinModes as you have usable pins.
How many usable pins do you have?

My guess is that you added an i/o pin with some other reserved functionality.

nodemcu is been used can add code if required

If you don't want guessing and crystal ball use, then you will have to post your code.

// Declare the Firebase Data object in the global scope
FirebaseData firebaseData1;
FirebaseData firebaseData2;
FirebaseData firebaseData3;

float level = 0, motor = 0;

String val, man, tmp, zero = "0" , one = "1";

// define pin numbers for ultrasonic sensor

const int trigPin = D7;
const int echoPin = D8;
const int motorPin = D5;

// defines variables for ultrasonic sensor
long duration;
int distance;

int lvlmax = 6; // maximum desired water level i.e.(tank height in cm - 2 cm) {ex. 10 - 2 = 8 cm}2
int lvlmin = 4; // minimum desired water level i.e.(tank height in cm - 8 cm) {ex. 10 - 8 = 2 cm}8

int lvlone = 3; // margin of level 1-6
int lvltwo = 4; // margin of level 2-5
int lvlthree = 5; // margin of level 3-3

int led = 11;
int led1 = 4;
int led2 = 2;
int led3 = 12;

void setup() {               
  // initialize the digital pin as an output.

  pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
  pinMode(echoPin, INPUT);// Sets the echoPin as an Input
  pinMode(motorPin, OUTPUT);//  Sets the motorPin as an Output

   pinMode(led2, OUTPUT);
  pinMode(led1, OUTPUT);
    //pinMode(led, OUTPUT);
    pinMode(led3, OUTPUT);
  Serial.begin(115200);                                   // Select the same baud rate if you want to see the datas on Serial Monitor

  Serial.println("Serial communication started\n\n");

  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);                                     //try to connect with wifi
  Serial.print("Connecting to ");

  while (WiFi.status() != WL_CONNECTED) {

  Serial.print("Connected to ");
  Serial.print("IP Address is : ");
  Serial.println(WiFi.localIP());                                            //print local IP address
  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);   // connect to firebase



void loop() {
 digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  {digitalWrite(led2, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led1, LOW);

Of course the number of IO-pins is limited. Just because any computerboard has a finite number of IO-pins.

You have to take a close look at each IO-pin what functionlity each IO-pin has and which of these functionalities are you using. Some of the IO-Pins are connected to special internal hardware-interfaces like hardware I2C or hardware-SPI or hardware Serial-interface.

Some libraries don't allow to define interface-pins because they just assume you are using that IO-pins that are connected to the internal-hardware-interface.

In your case IO-pin 11 is one of the IO-pins that is used for the connection to the flash-memory.
Don't mess around with this IO-Pin

best regards Stefan

many thanks for the information was in fact as you suggested using a pin that was used on by nodemcu
it also answers why on another sketch nodemcu and alexa was behaving the same when adding another pinmode to sketch
regards colin