Please help, slow compiling time

Please help me. I have a project that I have been working on for a long time. The project contains more than 10,000 lines of code. A few days ago, everything was working fine; I was using IDE 2.0.6 (ESP32 dev board). Now, when I try to verify or upload the sketch, it takes more than 20 minutes and I also get errors that I did not get before, even though I haven't changed the project. I have tried on several different computers and the same thing happens. On the same computer, I also have IDE 1.8x, where verifying the sketch also takes a very long time, more than 15 minutes, but I don't get any errors and I can upload the sketch to the ESP32.
Before this issue, the time to verify the sketch was about 3 minutes.

Hi @barboxxx.

Can you think of anything that changed between the last time it was "working fine" and the first time you noticed a problem?

Why do you say "was"? Are you using something different now than what you were using before?

Please provide a detailed description of what you mean by this. There has never been a 2.0.6 version of Arduino IDE.

I'm going to ask you to provide the full output from a compilation during which these errors occur.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Open your project in Arduino IDE.
  2. Select Sketch > Verify/Compile from the Arduino IDE menus.
  3. Wait for the compilation to fail.
  4. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  5. Open a forum reply here by clicking the "Reply" button.
  6. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  7. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  8. Move the cursor outside of the code block markup before you add any additional text to your reply.
  9. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Two of my favorite subjects: slow compiling and ESP32 platform/libraries.

Version 3.0.0 of arduino-esp32 was released five days ago, and has several breaking changes from v2 (the latest is currently 2.0.17, and there was a 2.0.6 from Dec '22 It is likely baked into your Board platform, directly or indirectly.

You can find your Board in the Boards Manager, see if the "Installed" version is 3.something; you can change it back to the latest 2.something, or to 2.0.6 if it is still listed.

IDE 2.txt (5.1 MB)

i tried to downgrade board manager but no success, also tried tu update IDE to newest

This error is caused by a syntax error at line 318 of your sketch.

You must specify a data type when you declare a variable.

Change line 318 of your sketch from this:

const WDT_TIMEOUT = 30;

To this:

const int WDT_TIMEOUT = 30;

After that, compile the sketch again. Hopefully this time it will be successful. If not, post the new output, just as you did before and we'll take another look.