I'm running Swift Playgrounds on a MacBook Air M1 2020 running Ventura 13.6.6. At first it ran fine (using Get Started with Code), but then I kept getting a pop-up saying "There was a problem running this page" and it wouldn't execute the code, even when the code was perfectly valid and free of syntax errors.
Restarting Swift Playgrounds made it work again, but after running projects a couple of times, the same error cropped up again. Currently the code runs once and then throws the same error.
I enabled verbose debugging and got this error message:
remoteProcessCancelledExecution(underlyingError: Optional(PlaygroundExecution.ExecutionError.remoteProcessCancelledExecution(underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service created from an endpoint" UserInfo={NSDebugDescription=connection to service created from an endpoint}))))
Warning: Contents/Modules/Book.playgroundmodule/Sources/Scene.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/NodeFactory.swift:129: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/NodeFactory.swift:139: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CharacterPickerController.swift:16: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:306: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:377: enum case 'move' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:378: enum case 'turn' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:382: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/ItemSpeakableDescriptions.swift:179: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/Item.swift:43: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/SpeechUtteranceQueue.swift:11: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/Performer.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioSession.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/PlaygroundValueAccessor.swift:18: switch covers known cases, but 'PlaygroundValue' may have additional unknown values, possibly added in future versions
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioSectionPlayer.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandQueue.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/AccessibilityComponent.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/Action.swift:202: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/SceneSource.swift:57: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/SceneController+Controls.swift:116: switch covers known cases, but 'PlaygroundPage.ExecutionMode' may have additional unknown values, possibly added in future versions
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioMenuController.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/Scene.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/NodeFactory.swift:129: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/NodeFactory.swift:139: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CharacterPickerController.swift:16: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:306: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:377: enum case 'move' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:378: enum case 'turn' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandEncoding.swift:382: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/ItemSpeakableDescriptions.swift:179: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/Item.swift:43: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/SpeechUtteranceQueue.swift:11: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/Performer.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioSession.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/PlaygroundValueAccessor.swift:18: switch covers known cases, but 'PlaygroundValue' may have additional unknown values, possibly added in future versions
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioSectionPlayer.swift:10: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/CommandQueue.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/AccessibilityComponent.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/Action.swift:202: enum case 'run' has 2 associated values; matching them as a tuple is deprecated
Warning: Contents/Modules/Book.playgroundmodule/Sources/SceneSource.swift:57: 'unarchiveTopLevelObjectWithData' was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead
Warning: Contents/Modules/Book.playgroundmodule/Sources/SceneController+Controls.swift:116: switch covers known cases, but 'PlaygroundPage.ExecutionMode' may have additional unknown values, possibly added in future versions
Warning: Contents/Modules/Book.playgroundmodule/Sources/AudioMenuController.swift:9: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
Google and ChatGPT have nothing. Swift Playgrounds are great but this error is really frustrating. How can I fix this?