Undefined Compile failed: Compiler encountered an error


#1

Hi,
Usually, you’ll get a good error message when compile fails. Right now I’m only receiving this:

attempting to compile firmware

undefined
Compile failed: Compiler encountered an error

That really does not give me much to work with? I’ve tried compiling other projects that I know are error free and they work. It’s probably an error in my code, but what could cause this and how can I pinpoint it?

I’m compiling on a Mac using CLI Version 1.35.1

Update
Turning on the Verbose output from CLI increases the output a little:

attempting to compile firmware

undefined
Compile failed: Compiler encountered an error
VError: Compile failed: Compiler encountered an error
at Promise.resolve.then.then.then.catch.err (/usr/local/lib/node_modules/particle-cli/dist/cmd/cloud.js:319:10)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
caused by: Error: Compiler encountered an error
at Promise.resolve.then.then.resp (/usr/local/lib/node_modules/particle-cli/dist/cmd/cloud.js:335:11)
at
at process._tickCallback (internal/process/next_tick.js:189:7)

This looks to be a node-related error? I’m currently using node version v8.12.0.


#2

Anyone? This completely prevents any work on my project. I really need help to get past this one…


#3

I’ve now tried all the tricks I can possibly think of. Even restoring the git repository back to a formerly known good state does not even help. I get this error no matter what I do. Other projects do still compile fine, but nothing in this folder works. I’ve also tried updating to CLI 1.35.2 and node v11.2.0. I also tried deleting the entire directory and restore it from git.


#4

Do you have a project.properties or library.properties file in your source folder? If not, you should create an empty one in that folder.

If you don’t have one in that folder, it will search parent directories which can cause surprising behavior.

I have no idea if that’s the cause, but it sound like you’ve tried everything else and it’s not a known problem that you’re running into.


#5

I have a “project.properties” in the folder. All it contains is “name=ProjectName”. it was originally created by the CLI.

This is for a custom made device that connects to AWS IoT and does realtime reporting of sales. We now have a couple hundred of them out in the wild and I was just implementing a tiny fix (5 lines of code). The code base for this project is rather large, but it’s well within the limits. I really have to get this working now as it’s been almost two weeks since I got the error and you’re the first to respond @rickkas7.


#6

From the looks of the error message, it fails in the _compileAndDownload method in the CLI:

… but I have no idea of what comes before this, so very hard to debug. It also does not take long for the error to be displayed. It happens maybe 4-5 seconds after hitting enter on the “particle compile p1” command.


#7

Is there any more output? You should submit a support ticket with the whole output so I can see if anything leading up to that looks unusual.


#8

There really is nothing out of the ordinary. It lists the files included in the compile, but then just returns the error above. I’ll submit a ticket now. I just added an issue on the CLI github page also.


#9

Can you try using Particle Workbench to compile your project? The compilation in the cloud fails and that’s what the CLI is returning but the error message must not be getting passed through.

https://community.particle.io/c/particle-workbench

#10

@jvanier I tried installing and it looks to work fine after I resolved a path problem: Particle workbench unable to locate Particle Firmware files

But - the problem with the Cloud Compiler persists… Anyone?