Offline IDE gives cryptic error message instead of error in include file assertion

The desktop IDE doesn’t seem to pass on valuable debugging information during certain compilation failures. Instead, it simply shows the dreadfully opaque “Compiler timed out or encountered an error.” message that is of no help in pinpointing the error.

Is there a way to access full error messages, just like the “Show Raw” button in the web IDE? If not, how should I request this feature? This feels of some urgency since it can makes the desktop IDE feel worthless when one gets no feedback on why something won’t compile.

Here’s an example statement that will reproduce the problem in Particle Dev 1.8.0 building for Electron 0.6.2 or 0.5.3:
Particle.variable("var_very_long_name", &var_max, INT);

The web IDE gives you a hint if you wade through the long list of raw error output to discover this message:

In Particle.variable, name must be 12 characters or less

Many thanks,

You can use particle compile to build from the command line. This will provide better error output.

Particle.variable("var_very_long_name", &var_max, INT);
// should be
Particle.variable("var_very_long_name", var_max);

and the max length for the name is 12 characters

It appears to be a bug. It only occurs if:

  • Your main source file has a .ino file extension
  • You have a file
  • You are targeting system firmware 0.6.0 or later

If any of those conditions is not true, then you’ll get the correct error messages as you’d expect.

For example, you can rename your source file to have a .cpp file extension instead of .ino and add to the top:

#include "Particle.h"

Or if you are not using any libraries, you can remove the file.

I’m not sure how long it will take for a bug fix, but either of those workarounds, or using the CLI, can be used to work around the problem for now.

You can track the status of this issue here:

Thanks for linking to that issue! (and also for the syntax-update, ScruffR)

Removing the file is an oddly effective workaround for now.

I’m looking forward to resolution in the Desktop IDE update promised soon in this issue: