CodeEdit
CodeEdit copied to clipboard
🐞 The document could not be opened
Describe the bug When I try to open this project, it only happens with this specific one from what I have seen so far, it gives me the following error.
I don't understand what caused it.
Screenshots
Desktop (please complete the following information):
- CodeEdit: 1.0 (1)
- MacOS: 12.3 (21E230)
- Xcode: 13.3 (13E113)
I'm getting the same error when opening certain directories, this is the error code
NSUnderlyingError=0x60000192a3d0 {Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"
@armartinez : Error does not print me, the console target what is set to when it gives you error:
The strange thing is that if I try to open a dir that is inside the one I want to open, it opens it.
What does the file path look like? Is it happening for other folders with a similar path too? What if you move the folder to a different location?
@lukepistrol : It seems that it only happens with this folder, but if I try as I said to open a folder that is inside it works, it opens the internal folder for me.
Is the folder read or write protected? please attach the output when you ls -l
the parent directory in terminal
@lukepistrol : drwxr-xr-x@ 28 nameUser staff 896 27 Mar 15:26 sol
@lukepistrol : The weird thing I had tried long ago to open it, it had opened it worked.
Nothing unusual here.
Is it some kind of system folder? like the user folder, desktop, documents, etc.?
Please share the pwd
@lukepistrol : I had document
printed here when I access the folder returns nil.
https://github.com/CodeEditApp/CodeEdit/blob/cb856a1d4ad2bb933b16a4a6c52d3f68486fefc5/CodeEdit/Documents/CodeEditDocumentController.swift#L28
it's just a folder on the desktop: /Users/nameUser/Desktop/sol
what is the error?
can you do print(document, documentWasAlreadyOpen, error)
?
@lukepistrol :
nil
false
Optional(Error Domain=NSCocoaErrorDomain Code=256 "The document “sol” could not be opened. " UserInfo={NSLocalizedDescription=The document “sol” could not be opened. , NSURL=file:///Users/nameUser/Desktop/sol/macos/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Resources, NSFilePath=/Users/nameUser/Desktop/sol/macos/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Resources, NSUnderlyingError=0x600002cff3f0 {Error Domain=NSCocoaErrorDomain Code=256 "The file “Resources” couldn’t be opened." UserInfo={NSURL=file:///Users/nameUser/Desktop/sol/macos/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Resources, NSFilePath=/Users/nameUser/Desktop/sol/macos/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Resources, NSUnderlyingError=0x600002cff3c0 {Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"}}}})
Could it be that some of the sub folders /Users/nameUser/Desktop/sol/macos/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Resources
in particular are stored in iCloud and are not actually downloaded to your machine at the moment?
I exclude it I don't use icloud.
I think it depends on the type of file called Resources
.
You can give it a try to see if it works for you.
Download the project, run this command on the project: yarn && npx pod-install macos
Then try to access the folder, to see what happens.
Link: project
Will do tomorrow.
@Angelk90 @lukepistrol I think the problem relates to Aliases, if you open them directly they work, but if you open the parent folder, it looks like the openDocument method treats them as folders when they are really files therefore it throws the error I shared. To solve this we need to either submit an issue to Apple or reimplement this openDocument method.
@lukepistrol Has this been fixed?
Is this still a problem?
@austincondiff yes