This likely a bug in Atom

Hi, just installed Particle Dev.
Unfortunately, hitting “compile” with the following code:

void setup()
{}
void loop()
{}

generates a red window with "this likely a bug in Atom"
and the following info:

[Enter steps to reproduce below:]

Atom Version: 0.0.24
System: Microsoft Windows 7 Professional
Thrown From: Atom Core

Stack Trace

Uncaught Error: ENOENT: no such file or directory, uv_chdir

At D:\programs\Particle Dev\resources\app.asar\node_modules\babel-core\node_modules\regenerator\node_modules\commoner\node_modules\graceful-fs\polyfills.js:14

Error: ENOENT: no such file or directory, uv_chdir
  at Error (native)
  at process.chdir (D:\programs\Particle Dev\resources\app.asar\node_modules\babel-core\node_modules\regenerator\node_modules\commoner\node_modules\graceful-fs\polyfills.js:14:9)
  at D:\programs\Particle Dev\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:661:21
  at Object.module.exports.projectRequired (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:254:4)
  at D:\programs\Particle Dev\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:639:24
  at Object.module.exports.loginRequired (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:239:4)
  at Object.module.exports.compileCloud (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:461:37)
  at atom-workspace.disposables.add.atom.commands.add.spark-dev:compile-cloud (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:76:37)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:233:26)
  at CommandRegistry.handleCommandEvent (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:1:0)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:180:5)
  at space-pen-button.<anonymous> (D:\spark-dev115510-2736-1mddsn1\node_modules\tool-bar\lib\tool-bar-button-view.coffee:28:24)
  at space-pen-button.jQuery.event.dispatch (D:\programs\Particle Dev\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
  at space-pen-button.elemData.handle (D:\programs\Particle Dev\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)

Commands

     -7:45.3.0 core:move-down (atom-text-editor.editor.is-focused)
     -7:42.7.0 spark-dev:compile-cloud (atom-text-editor.editor)
     -7:36.2.0 spark-dev:flash-cloud (atom-text-editor.editor)
 13x -7:32.8.0 spark-dev:core-status-updated (atom-workspace.workspace.scrollbars-visible-always.theme-monokai.theme-one-dark-ui)
     -1:04.5.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
     -1:02.7.0 spark-dev:core-status-updated (atom-workspace.workspace.scrollbars-visible-always.theme-monokai.theme-one-dark-ui)
  2x -0:46.7.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -0:40.9.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:37.7.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:37 editor:newline (atom-text-editor.editor.is-focused)
     -0:32.8.0 spark-dev:core-status-updated (atom-workspace.workspace.scrollbars-visible-always.theme-monokai.theme-one-dark-ui)
     -0:30.6.0 editor:newline (atom-text-editor.editor.is-focused)
  4x -0:28.1.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:26.9.0 core:delete (atom-text-editor.editor.is-focused)
     -0:22.5.0 core:save (atom-text-editor.editor)
     -0:07.6.0 spark-dev:compile-cloud (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "monokai"
    ]
  },
  "editor": {
    "invisibles": {}
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

@suda Might be able to help you out here.

Hey @kefir135 could you take a screenshot of Particle Dev and share it here?

@suda, I just reinstalled the latest DEV on windows and compiled an empty setup/loop for both Core and Photon and had no errors. I created the target file in an empty folder.

Couple of quick suggestions for a first time Particle Dev user. First, although it is in the doc web page, it is easy to miss the instruction to make sure that your program file is in its own folder. All by itself.

Second, make sure to choose the spark or particle choice for languge (bottom right corner. Mine still says Spark). Save it as a Spark type file.

Give those two suggestions a try.

OH YEA, this one will get you too, once you start using Dev. Always save your program before compiling. If you don’t, you will get a successful compile indication, but when you flash the code to the photon, the last SAVED version, compiled, will be flashed, not the version on the screen in front of you. Yea, confusing, and unusual, right?

So, one folder per program. Save as Spark type file. Save before compile. Three rules of Spark Dev that can bind you up and waste a lot of time if learned the hard way. Good luck.

@peekay123 which version of Windows do you use?

@Bendrix, excellent points!

@suda, win7x64

I’m seeing the same error.

I have Spark as the selected language, my code is from the “Read your Photoresistor: Function and Variable” example in the docs.

I’ve attached a screenshot at the end of this post.

Dump from Atom:

Atom Version: 0.0.24
System: Mac OS X 10.10.3
Thrown From: spark-dev package, v0.0.23

Stack Trace

Uncaught Error: ENOENT: no such file or directory, uv_chdir

At /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:474

Error: ENOENT: no such file or directory, uv_chdir
  at Error (native)
  at /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:661:21
  at Object.module.exports.projectRequired (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:254:4)
  at /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:639:24
  at Object.module.exports.loginRequired (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:239:4)
  at Object.module.exports.compileCloud (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:461:37)
  at atom-workspace.disposables.add.atom.commands.add.spark-dev:compile-cloud (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:76:37)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:233:26)
  at CommandRegistry.handleCommandEvent (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:1:0)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:180:5)
  at EventEmitter.<anonymous> (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/window-event-handler.coffee:51:20)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:166:7)

Commands

     -2:03.6.0 spark-dev:append-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling)
     -2:03.6.0 spark-dev:update-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling)
     -2:03.6.0 spark-dev:append-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling)
     -2:03.4.0 spark-dev:update-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -2:03.4.0 spark-dev:append-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -2:03.4.0 spark-dev:update-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -2:03.4.0 spark-dev:append-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -2:01.0 core:close (atom-text-editor.editor.is-focused)
     -0:56.6.0 core:save-as (atom-text-editor.editor.is-focused)
     -0:07.3.0 spark-dev:select-device (atom-text-editor.editor.is-focused)
     -0:05.8.0 spark-dev:update-core-status (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:05.8.0 spark-dev:update-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:05.8.0 spark-dev:append-menu (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:05.4.0 spark-dev:core-status-updated (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:00.8.0 spark-dev:compile-cloud (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ],
    "projectHome": "/Users/edalquist/particle"
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

I note that the name of your folder is Config. That’s a funny name. Is that the name of your prrogram file also? Could you expand that folder, Config ,in the file viewer to show us what else is in the folder with your program?

Best practice would be to have a folder with the same name as your program, and nothing else in that folder. Want to try that, and then try another compile?

That is the Config folder of the IDE, it just showed up after going through the IDE config.

I have a folder with just the .ino file in it. The CLI tool works to build/flash the same .ino file.

When using Spark Dev you must put the program file in a folder of its own, by the same name, with nothing else in that folder. Have a look at the instructions on the Particle Dev help page;

Compiling Code
Before compiling your project, make sure your project files are in a dedicated directory.Notes:
If other files not related to your project are present in the project directory, you may experience errors when trying to compile.
All the files have to be on the same level (no subdirectories) like this (example shown on docs page)

here : http://docs.particle.io/photon/dev/

You should see that unique folder in the folder view of dev, with your program file under it. If not, you won’t get a compile.

1 Like

Hi everybody,

so I have an empty sketch with just setup and loop, saved in an empty folder, under the same name as the folder, the type is Spark, and thanks for all your remarks, but none of them helps. Windows 7 professional.
Still the same error, which seems to have nothing to do with sketch, it’s type, folders it’s just the Atom itself not working.

Can you post a screen shot?

sure

me too same issue…it was working originally then just started getting this issue.

I will look into the file/folder names later to see if that fixes it.

I notice that your lower left corner indicated Spark, but your file type fie panel indicates CPP. I believe it should be .INO Not sure why that would cause the error, but its worth a try. Particle Dev is a bit finicky with file locations, names and extensions. It’s not as easy to use as Xcode or Arduino, where the folders are created for you and the exensions are managed by the IDE.

Close everything, start with an empty file, select type spark use the menu choice File -> Add Project Folder to create a folder and then save the file in that folder.

The folder/file naming fix worked for compilation for me, I’ll try flashing tonight.

Glad to hear it. @suda, take a note of this thread. The Dev IDE has these idiosyncrasies and as Particle grows and attracts new customers, more and more of this forums time, and potential, yours, (when forum members tire of giving out free help for issues we’d like to see addressed by particle) will be consumed by these types of issues. The Docs may have this info, but its like someone reversing the operation of the steering wheel on your car. If your car is the only one that behaves in this weird way, people are going to get frustrated.

Just sayin…

There is a workaround on github for this issue, which worked for me.

Work Around

  • Run Particle Dev, which normally brings up the previous project code
  • Click File: New Window
  • Click Open Folder…
  • Navigate to the folder that contains the .ino file I want to edit/compile, select it, which loads the files in the folder into the left side of the IDE.
  • Click on the .ino file to load it into the editor.
  • Click on “Compile and show errors, if any”

So the same thing happened to me. I fixed it by opening a new file saving it as ___.ino in a folder on my desktop. Everything worked fine and everything compiled, Until I saved and closed. When I went to reopen it my .ino file was blank! :scream: So I was wondering if this is happening to anyone other than me? It is very annoying to have to re-write all of my code! :blush: