Impossible to compile

Hi guys,
I’m trying to test an example of yours, ‘Blink an LED’, but, after selecting my device, I can’t flash it. I made no changes to the code, but in Web IDE I’m getting:

Error: Could not compile. Please review your code.

I’m a bit lost. Any advice would be helpful.

Thanks
Kind regards
Federico

Can you try an empty app and compile to see what happens?

Hey, @fcordeg.

Just to make sure everything was working (compile service and APIs), I did as you described and created a new app in the Web IDE by clicking on the “Blink An LED” link and then the “Use This Example” button. I was able to compile and flash to a Photon using that example and everything worked fine. I used the Particle CLI to compile for a Core and it was able to compile as well.

@kennethlimcp’s suggestion is a good one. Try compiling an empty app, i.e. an app that looks like this:

void setup() {
}

void loop() {
}

And see if it’ll compile. If it doesn’t, please let us know (and include as much of the error message as you can).

Thanks!

Hi,
thanks for the reply. I tryed what you suggested, but the result is always the same: ‘Error: Could not compile. Please review your code.’
There are no other indication about the nature of the error.
If I use Particle Dev, I have some feedbacks:

I forgot to tell you that I’m using a spark core, not a photon and it worked, up to few days ago. Besides I’m still able to pilot my spark core with the Spark app right now.

Thanks again
Kind Regards
Federico

You were talking about Web IDE but your image looks more like Particle Dev.
Which one are you using?

For Particle Dev you could provide a (non-red please) screenshot of the whole window, since there are common problems that can easily be seen if you know what you’re looking for, but rather tedious to describe via keyboard :wink:

For Web IDE as screenshot with the pulled out devices/target drawer migth help too.

Hi,
I’m using both: in the WEB IDE I just can see ‘Error: Could not compile. Please review your code.’
The device is the following:

I tried also to use Particle Dev and the reply was:

Uncaught TypeError: Cannot read property 'replace' of undefined
C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:51
Hide Stack Trace
TypeError: Cannot read property 'replace' of undefined
  at CompileErrorsView.module.exports.CompileErrorsView.fixInoFile (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:57:22)
  at Object.content (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:87:21)
  at Builder.tag (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:281:19)
  at Function.View.(anonymous function) (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:83:49)
  at Function.<anonymous> (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:78:21)
  at Function.View.buildHtml (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:123:10)
  at Function.View.render (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:129:19)
  at exports.$$ (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:627:24)
  at CompileErrorsView.module.exports.CompileErrorsView.viewForItem (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:77:14)
  at CompileErrorsView.module.exports.SelectListView.populateList (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:206:29)
  at CompileErrorsView.module.exports.SelectListView.setItems (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:167:12)
  at CompileErrorsView.module.exports.CompileErrorsView.show (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:67:14)
  at CompileErrorsView.show (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\views\compile-errors-view.js:3:61)
  at Object.module.exports.showCompileErrors (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:817:37)
  at atom-workspace.disposables.add.atom.commands.add.spark-dev:show-compile-errors (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:117:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:145:19)
  at C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:737:29
  at Object.module.exports.projectRequired (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:382:14)
  at C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:676:24
  at Object.module.exports.loginRequired (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:364:14)
  at Object.module.exports.compileCloud (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:674:19)
  at atom-workspace.disposables.add.atom.commands.add.spark-dev:compile-cloud (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:132:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\src\command-registry.js:145:19)
  at space-pen-button.<anonymous> (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\tool-bar\lib\tool-bar-button-view.js:42:36)
  at space-pen-button.jQuery.event.dispatch (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
  at space-pen-button.elemData.handle (C:\Users\fcordeg\AppData\Local\particle\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)
The error was thrown from the spark-dev package.
Create issue on the spark-dev package

Thanks in advance
Kind Regards
Federico

P.S.: the code, as suggested, is

void setup() {

}

void loop() {

}

What I don’t see on your screenshot is the target star next to your devices name.
And your device is not recognized, it’s refered as Other rather than Core, Photon or Electron.
Have you had this device set up on the Particle Dashoard or have you had code running on it before that used the PRODUCT_ID() macro?

It should look like this

About the Other-matter, @jtzemp might be able to have a look at a solution from the Particle side of things.

Hi,
thanks! Thanks a lot for your precious help! You gave me the right clues and I finally was able to compile.

I cancelled and rebuild the configuration of my device on the dashboard and everything started to work fine.

Kind regards and Happy new Year
Federico

1 Like