Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command "carton dev" failed #258

Closed
renaudjenny opened this issue Aug 14, 2020 · 3 comments
Closed

Command "carton dev" failed #258

renaudjenny opened this issue Aug 14, 2020 · 3 comments

Comments

@renaudjenny
Copy link

Hi there,

First of all, thanks for this amazing project, it looks so promising!
Unfortunately, I wasn't able to test it, I don't know what I'm doing wrong, I think I followed all instructions but I got this error:

➜  TokamakApp carton dev
Polyfill integrity verified: /Users/renaudjenny/.carton/static/dev.js
Inferring basic settings...
- swift executable: /Users/renaudjenny/.carton/sdk/wasm-DEVELOPMENT-SNAPSHOT-2020-06-12-a/usr/bin/swift
Swift version 5.3-dev (LLVM b54b6b832e, Swift 4bb1458ec4)
Target: x86_64-apple-darwin19.5.0

Parsing package manifest: /Users/renaudjenny/.carton/sdk/wasm-DEVELOPMENT-SNAPSHOT-2020-06-12-a/usr/bin/swift package dump-package
- development binary to serve: /Users/renaudjenny/Sources/TokamakApp/.build/wasm32-unknown-wasi/debug/TokamakApp

Building the project before spinning up a server...
/Users/renaudjenny/.carton/sdk/wasm-DEVELOPMENT-SNAPSHOT-2020-06-12-a/usr/bin/swift build -c debug --product TokamakApp --enable-test-discovery --destination /Users/renaudjenny/.carton/sdk/wasm-DEVELOPMENT-SNAPSHOT-2020-06-12-a.json
/Users/renaudjenny/Sources/TokamakApp/Sources/TokamakApp/main.swift:9:16: error: cannot find 'DOMRenderer' in scope
let renderer = DOMRenderer(ContentView(), div)
               ^~~~~~~~~~~
Process failed, check the build process output above.

It looks like a dependency isn't updated or something, but if I try

➜  TokamakApp swift package update
/Users/renaudjenny/Sources/TokamakApp: error: package at '/Users/renaudjenny/Sources/TokamakApp' is using Swift tools version 5.3.0 but the installed version is 5.2.0

And it's right, the Package.swift is meant for Swift 5.3.
However, In the README it's specified that the Xcode-select should be the one from the current stable Xcode version (at the time of this ticket is written it's 11.6, so Swift 5.2, but maybe I'm wrong and I should switch my Swift version?).

I also tried to clone the project and carton dev, but it failed as well for another reason:

➜  Tokamak git:(main) carton dev
Polyfill integrity verified: /Users/renaudjenny/.carton/static/dev.js
Inferring basic settings...
- swift executable: /Users/renaudjenny/.carton/sdk/wasm-5.3-SNAPSHOT-2020-07-27-a/usr/bin/swift
Swift version 5.3-dev (LLVM 6fca49be4a, Swift bf51b9a7e6)
Target: x86_64-apple-darwin19.5.0

Parsing package manifest: /Users/renaudjenny/.carton/sdk/wasm-5.3-SNAPSHOT-2020-07-27-a/usr/bin/swift package dump-package
Failed to disambiguate the development product
Pass one of ["TokamakDemo", "TokamakStaticDemo"] to the --product option
Error: No executable product to build could be inferred

The second error sounds easier to fix, but I really don't know where to look 🥺. Sorry that I can't really help as I'm very new to the project.
But let me know, I would be really happy to give a hand at some point.

Thanks folks!

@carson-katri
Copy link
Member

carson-katri commented Aug 14, 2020

I think the template is outdated. Try this in main:

struct MyApp: App {
  var body: some Scene {
    WindowGroup("MyApp") {
      ContentView()
    }
  }
}

MyApp.main()

@carson-katri
Copy link
Member

For running the demo you can do carton dev --product TokamakDemo

@renaudjenny
Copy link
Author

Both suggestion are working fine!
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants