Unable to save documents - Error: undefined



I’ve just started using Atom as a possible replacement for jEdit.

I am unable to save documents, i get “Error: undefined”. I’ve tried to move Atom to C:\program files instead of %appdata% and I’ve tried to save it multiple locations including the desktop. The only package I’ve installed is remote-ftp.

Atom 1.23.3 x64
Windows 10 Pro 64-bit (10.0, Build 16299)



I’ve never seen this error before. What happens if you start Atom in safe mode by opening the command line and using the command atom --safe?

Did you do this before the errors started showing up? If not, I would suggest undoing whatever you’ve done so that you can troubleshoot with a standard installation.


Thanks for the reply.

I moved it to Program Files after it didn’t work to run it from &appdata%. I re-installed it now, but almost same error. Now it says the following “File not found. Check the file name and try again.”. I’ve tried different names, different locations and different file formats. Same behavior in safe mode.


Are you able to save files that already exist on disk? So far both of the examples you’ve presented have involved saving new files.


I don’t get an error message by saving (either using ctrl+s or closing the tab and selecting save), but it doesn’t actually save the changes.


I haven’t seen anything like this before and thus have no insight. 1.24.0 just released today, so you should see if it works after updating. If that doesn’t work, you can download the beta version and set it up as a portable installation and see if that works.


Having the same issue. Also on Windows 10 Pro. I can add that for me saving to anywhere in C:\Users_myUser_\Documents\ does not work, while other locations, in C: do work (looks like @Jinstarro was also trying to save to the Documents folder). Other programs, such as Notepad++ can save to that location, so it is not a general permission issue.

I am on 1.24.0 and this did not resolve the issue. I have not tried the beta release.

I get:

Uncaught (in promise) Error: EBADF, write

in the developer console when trying to save with Ctrl+S.

I checked folder permissions and app permissions in Windows Defender, but that did not make a difference.


What happens when you do?



I checked more. It is a problem with the Windows Defender controlled folder access feature.

It happens for at least for 1.23.3, 12.4.0 and 1.25.0-beta0. The beta in portable mode. In portable mode, I get notifications that defender is blocking folder access, for the others I do not, but saving fails with the error messages shown by @Jinstarro.

To get things working I can turn off controlled folder access (which I do not want ot do) or explicitely allow atom through, see screen shot. I did not fully appreciate yesterday that it is not sufficient to just allow atom.exe in the default location (C:\Users\myUser\AppData\Local\atom), but that I also had to allow atom.exe in the corresponding app-version-nr sub-folder. This seems fine for now, however, I will have to remember to allow the new executables through after each upgrade, which seems inconvenient (update.exe also needs to be added). Is there a way to get atom whitelisted by Microsoft? As I mentioned Notepad++ does not have the same issues.



Trying again to upload the screen shot.


Hopefully this isn’t digging up an old thread since I just came across the same issue and the above wouldn’t have solved it for me. The error I received was exactly the same when I tried to save (although it wouldn’t have shown by pressing ctrl+s since it wouldn’t save, but rather by trying to close an unsaved file and trying to save then).

What I did to resolve it was remembered I had other programs/apps accessing the project, and in particular I had git bash opened and git diff running (which I could close by pressing the Q key). Once I ended the diff and nothing was accessing the project, I could save that file. I tried restarting atom but of course this problem was an external factor.

This might be slightly different from what was experienced here but still, just make sure the file you are trying to save isn’t being accessed by another app.


I had the same problem. I figured out that was an issue with codification. In txt file that I was trying to save, there was an invalid character to the active codification (ISO 8859-1). When I deleted this invalid character or changed the codification, the file had been saved normally.