I quite frequently get the error "Exception: getCurrentDirectory: does not exist (No such file or directory)" in the playground. If I modify something and save, the error is gone. Not sure what causes it exactly though.
8 comments
-
Manuel Chakravarty Thanks for reporting this. If you click on the triangle icon on the top right of the playground to re-evaluate, do the errors disappear as well?
-
Kamil Kisiel I've also seen this. Usually it happens when I delete a chunk of code from the editor. Then some parts of the playground will evaluate to
"** Exception: getCurrentDirectory:getWorkingDirectory: invalid argument (Invalid argument)"
Usually re-saving the file one more time seems to clear it up though. I don't know how things work under the hood, but maybe some temporary file paths are getting changed?
-
Manuel Chakravarty Kamil, thank you for the additional information. I will investigate.
-
mert inan any investigation result?
-
Manuel Chakravarty Mert, have you got that same problem?
The original issue was resolved quite a while ago. I have still seen this infrequently, but never found a reliable way to reproduce it. If you have got any additional information, please let me know. Thanks!
-
Paul Summermatter I'm experiencing this same problem with 1.6.0 (just downloaded from the Apple App Store). It seems as though you cannot save the project to an iCloud drive folder and call functions whether they are defined in Main.hs or in the Playground. Other simple statements such as x=5 work without issue, but defining a function and then calling that function results in the following exception (note that the function definition part seems to work just fine)
** Exception: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)
I used the File>Move To option to move the file/project to my ~/Desktop folder, and the problem immediately disappeared without editing any of the code in the playground or the Main.hs pane.
-
Dan Kilman This happened to me as well when the project was located inside a directory that had its own stack.yaml. I moved the project out of it and the issue was resolved.
-
Manuel Chakravarty Thanks, Dan. That is an interesting data point.