BlynkEdgeNt Compile fail in PIO and Arduino even with example code

I had working BlynkEdgenet code developed in PIO but then had compile errors . Having tried everything and failed I just tried compiling the example code for ESP32 in the Arduino IDE 2.3.2 and the only change I made was valid credentials but the code fails with
Compilation error: ‘WiFi’ was not declared in this scope

Code is below, Ive removed credentials

/*************************************************************
  Blynk is a platform with iOS and Android apps to control
  ESP32, Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build mobile and web interfaces for any
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: https://www.blynk.io
    Sketch generator:           https://examples.blynk.cc
    Blynk community:            https://community.blynk.cc
    Follow us:                  https://www.fb.com/blynkapp
                                https://twitter.com/blynk_app

  Blynk library is licensed under MIT license
 *************************************************************
  Blynk.Edgent implements:
  - Blynk.Inject - Dynamic WiFi credentials provisioning
  - Blynk.Air    - Over The Air firmware updates
  - Device state indication using a physical LED
  - Credentials reset using a physical Button
 *************************************************************/

/* Fill in information from your Blynk Template here */
/* Read more: https://bit.ly/BlynkInject */
#define BLYNK_TEMPLATE_ID "XXXXXXXXXX"
#define BLYNK_TEMPLATE_NAME "LED ESP32"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_ESP32_DEV_MODULE
//#define USE_ESP32C3_DEV_MODULE
//#define USE_ESP32S2_DEV_KIT
//#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_TTGO_T_OI

#include "BlynkEdgent.h"

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();
}


If you’d searched this forum for that compiler error message then you’d have found several topics about it, like this one…

Downgrade your ESP32 core to 2.x.x and it’ll fix the issue.

Pete.

Ok, I had seen that for Arduino but when I looked at the ESP32 example in the library has a PIO configuration and it states 6.5.0, I dont know what that corresponds to in the equivalent Arduino framework however 2.XX seems to be 4.4.7.
Building in Arduino with 2.017 does work but its not an IDE I use so a bit of a dead end.
Ive downgraded the esp to 4.4.7 but it still has compile errors and to check Ive used another program and it compiles fine so I think it is the Blynk software and some other dependency other than just the IDF, I dont know why it was working fine unitl a recent compile.

Can’t help I’m afraid, I’m not a PIO user.

Pete.