TokamakUI / Tokamak

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
Apache License 2.0
2.62k stars 111 forks source link

Fatal error after getting started guide #509

Open pnewell opened 2 years ago

pnewell commented 2 years ago

Describe the bug I went through the getting started guide in full, and on the last step I run carton dev and terminal seems to crash? ultimately I get the following response: "Error: fatalError"

To Reproduce Steps to reproduce the behavior:

  1. carton dev

Expected behavior Dev environment initializes, loads at http://127.0.0.1:8080/

Screenshots If this is a layout/rendering issue, please provide screenshots for both Tokamak and SwiftUI that highlight the difference. Screenshot 2022-08-19 at 9 36 31 PM Redacted Screenshot 2022-08-19 at 9 39 21 PM Redacted

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

MaxDesiatov commented 2 years ago

Could you provide more details about your environment please? What's the exact version of macOS beta are you running? Is this error reproducible for you with other macOS versions?

Wouter01 commented 2 years ago

Hi, I've got this error too on the latest macOS Ventura beta. I was able to work around this by installing the latest version of swiftwasm and then setting this as the version for building. However, then I got errors while building with carton dev. I've added the errors I got (EDIT: removed because they are fixed). I don't know if it's relevant but it's something I guess.

Edit: Seems like the build errors are already fixed. If you change the dependency in Package.swift to .package(url: "https://github.com/TokamakUI/Tokamak", branch: "main") it will compile. However, I only get a blank screen (dev and release build)

MaxDesiatov commented 2 years ago

However, I only get a blank screen (dev and release build)

This is expected on the main branch, as a major refactoring is in progress (cc @carson-katri)

Wouter01 commented 2 years ago

However, I only get a blank screen (dev and release build)

This is expected on the main branch, as a major refactoring is in progress (cc @carson-katri)

Got that! Weird thing is, if I use the latest release (0.10.1) and just fix the bug that prevents compiling there, it'll also show a blank screen.

OmerFlame commented 2 years ago

@Wouter01 I am currently experiencing the same difficulties. I took the liberty to take a look at the console in the browser and found a JavaScriptKit error that goes as follows:

JavaScriptKit supports only WASI reactor ABI. Please make sure you are building with: -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor

And looking at the build command that carton is running, we can see that JavaScriptKit's requirements are not being met:

/Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2022-09-01-a.xctoolchain/usr/bin/swift build -c debug --product TokamakApp --triple wasm32-unknown-wasi -Xlinker /Users/omershamai/.carton/static/so_sanitizer.wasm -Xlinker --stack-first

Seems like the Tokamak team needs to fix their build script.

EDIT: I just noticed that I can pass through my own commands, so I pushed ahead and input the commands required by JavaScriptKit. It compiled, but then I got another JavaScript error in the browser console, this time it's much more ambiguous:

TypeError: instance.exports.main is not a function. (In 'instance.exports.main()', 'instance.exports.main' is undefined)

Something's off here.

rayanwaked commented 2 years ago

I just started using Tokamak today and I was confronted by this same issue. In my case, Xcode did not have any Command Line Tools selected, which resulted in this error. To fix this, I did the following:

Diagnose

Open your Terminal and type the command below

xcode-select -p

If your Terminal outputs no developer tools were found at '/applications/xcode.app', then you need to open Xcode and select a CLT.

Select CLT

Xcode > Preferences > Locations > Command Line Tools > Xcode XX.X.X.

Make sure the directory below displays /Applications/Xcode.app

Confirm

Run xcode-select -p again, and it should output /Applications/Xcode.app/Contents/Developer.

Note: If you have both Xcode and Xcode Beta. Do not select the Xcode Beta CLT, for me the error didn't go away when it was selected.

Hope this helps.

OmerFlame commented 2 years ago

This has been fixed as of release 0.11.0. Please close.

Wouter01 commented 2 years ago

This has been fixed as of release 0.11.0. Please close.

I just tested again, and I'm still getting errors. This time, I got the same error you wrote about earlier:

TypeError: instance.exports.main is not a function. (In 'instance.exports.main()', 'instance.exports.main' is undefined)

I'm using v 0.11 with swift-wasm-5.7.1-RELEASE

mcritz commented 2 years ago

Still getting same error on latest macOS

rayanwaked commented 2 years ago

Still getting same error on latest macOS

Run brew install swiftwasm/tap/carton in terminal then cd to your project and carton dev again. It should work afterwards.

Make sure you have the correct command line tool selected in Xcode, as well.

mcritz commented 2 years ago

brew install swiftwasm/tap/carton still downloads https://github.com/swiftwasm/carton/releases/download/0.16.0/carton-0.16.0.monterey.bottle.tar.gz

and I still get fatalError with carton dev

mcritz commented 2 years ago

Running carton dev --verbose gets this:

HelloTokamak % carton dev --verbose
- checking Swift compiler path: /Users/mcritz/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/mcritz/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: x86_64-apple-darwin22.2.0

Parsing package manifest: 
[debug]: evaluating manifest for 'hellotokamak' v. unknown 
[error]: invalidManifestFormat("<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:371:81: error: function does not return string type\n- (nullable instancetype)initWithUTF8String:(const char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);\n                                                                                ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:372:52: error: function does not return NSString\n- (instancetype)initWithString:(NSString *)aString NS_FORMAT_ARGUMENT(1);\n                                                   ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:387:53: error: function does not return NSString\n+ (instancetype)stringWithString:(NSString *)string NS_FORMAT_ARGUMENT(1);\n                                                    ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:389:83: error: function does not return string type\n+ (nullable instancetype)stringWithUTF8String:(const char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);\n                                                                                  ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:395:114: error: function does not return string type\n- (nullable instancetype)initWithCString:(const char *)nullTerminatedCString encoding:(NSStringEncoding)encoding NS_FORMAT_ARGUMENT(1);\n                                                                                                                 ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:396:97: error: function does not return string type\n+ (nullable instancetype)stringWithCString:(const char *)cString encoding:(NSStringEncoding)enc NS_FORMAT_ARGUMENT(1);\n                                                                                                ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface:9:19: error: could not build Objective-C module \'Foundation\'\n@_exported import Foundation\n                  ^\n/Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI/PackageDescription.swiftinterface:4:8: error: failed to build module \'Foundation\'; this SDK is not supported by the compiler (the SDK is built with \'Apple Swift version 5.7.1 (swiftlang-5.7.1.134.4 clang-1400.0.29.51)\', while this compiler is \'SwiftWasm Swift version 5.6 (swiftlang-5.6.0)\'). Please select a toolchain which matches the SDK.\nimport Foundation\n       ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Users/mcritz/Developer/HelloTokamak/Package.swift:2:8: error: failed to build module \'PackageDescription\' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug\nimport PackageDescription\n       ^", diagnosticFile: nil)Error: fatalError
alvarhansen commented 1 year ago

I was trying to run carton dev --product TokamakDemo on master (f1cbfcf073e2675566b0e9aa337441357d40d88a) and got same/similar fatal error. Fix for me was to change .swift-version to wasm-5.7.1-RELEASE.

diff --git a/.swift-version b/.swift-version
index 08ddfb7..11e165e 100644
--- a/.swift-version
+++ b/.swift-version
@@ -1 +1 @@
-wasm-5.6.0-RELEASE
+wasm-5.7.1-RELEASE
kdeda commented 1 year ago

Decided to take this for an initial spin and out of the box we fail. Xcode 14.3, Ventura 13 I'm glad to report @alvarhansen tips worked, however using wasm-5.8.0-RELEASE does not, but that is not a problem. Great work.

airstrike commented 8 months ago

Installed carton from homebrew and TokamakUI from the cloned repo as instructed in the README and also got fatalError. The fact that the error clears my terminal log doesn't help reporting...

 ✔ carton dev --product TokamakDemo
- checking Swift compiler path: /Users/andy/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: arm64-apple-darwin23.3.0

Parsing package manifest:
[debug]: evaluating manifest for 'tokamak' v. unknown

so I ran with --verbose and got

- checking Swift compiler path: /Users/andy/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: arm64-apple-darwin23.3.0

Parsing package manifest: 
[debug]: evaluating manifest for 'tokamak' v. unknown
[error]: Invalid manifest (compiled with: ["/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/np/tj3n126j4x7d2d4hw6ndhx2w0000gn/T/TemporaryDirectory.5t2Mm1/vfs.yaml", "-L", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-target", "arm64-apple-macosx11.0", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-F", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks", "-I", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-L", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-swift-version", "5", "-I", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-package-description-version", "5.6.0", "/Users/andy/projects/Tokamak/Package.swift", "-o", "/var/folders/np/tj3n126j4x7d2d4hw6ndhx2w0000gn/T/TemporaryDirectory.HIHaEi/tokamak-manifest"])
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:1694:33: error: expected parameter name followed by ':'
    @preconcurrency case custom(@Sendable (Foundation.Date, any Swift.Encoder) throws -> Swift.Void)
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:1699:33: error: expected parameter name followed by ':'
    @preconcurrency case custom(@Sendable (Foundation.Data, any Swift.Encoder) throws -> Swift.Void)
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:5064:28: error: expected ',' separator
  @_backDeploy(before: iOS 17, macOS 14, tvOS 17, watchOS 10)
                           ^
                          ,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:19:26: error: no type named 'DispatchQueue' in module 'Dispatch'
    case custom(Dispatch.DispatchQueue?, @convention(block) () -> Swift.Void)
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:66:47: error: no type named '__DispatchData' in module 'Dispatch'
  public typealias _ObjectiveCType = Dispatch.__DispatchData
                                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:11:15: error: type 'DispatchData' does not conform to protocol '_ObjectiveCBridgeable'
public struct DispatchData : Swift.RandomAccessCollection, Swift._ObjectiveCBridgeable {
              ^
Swift._ObjectiveCBridgeable:2:20: note: protocol requires nested type '_ObjectiveCType'; do you want to add it?
    associatedtype _ObjectiveCType : AnyObject
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:75:84: error: no type named '__DispatchData' in module 'Dispatch'
  @_semantics("convertToObjectiveC") public func _bridgeToObjectiveC() -> Dispatch.__DispatchData

// ... thousands of other output rows omitted here...

/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI/PackageDescription.swiftinterface:4:8: error: failed to build module 'Foundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9.2 (swiftlang-5.9.2.2.11 clang-1500.1.0.2.2)', while this compiler is 'SwiftWasm Swift version 5.6 (swiftlang-5.6.0)'). Please select a toolchain which matches the SDK.
import Foundation
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/Foundation.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:
#import <Foundation/NSBundle.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
#import <Foundation/NSString.h>
        ^
Error: fatalError        

This is because the current SwiftWasm release (5.6) is behind Swift SDK (5.9+)

I'm not sure if the previous comments on this thread were dealing with the same issue, as fatalError is just too generic to accurately tell what happened. So it actually feels like Tokamak should first check if there are SDK issues (and check for other issues faced by previous commenters) and guide users to a resolution (or explanation, at a minimum)

See also #555 and https://github.com/swiftwasm/swift/issues/5562