Closed bobhy closed 1 year ago
I'm in the same boat - never used Kotlin before, decided to check it out and getting a first time user experience of a broken flagship demo app. And I'm using IntelliJ IDEA to boot.
When you get to step 3 you have additional problems with method
needs to be allowMethod
, and multiple more missing imports. Seems as though this whole project needs updated.
Edit: Interestingly, there seems to be another version of the Multiplatform tutorial here which has updated code that seems to fix the above issues. https://kotlinlang.org/docs/multiplatform-full-stack-app.html
Unfortunately, you hit us in the awkward phase of migrating different parts of the project a) to new Kotlin versions and b) to a new learning platform that was more aligned with the rest of the Kotlin documentation – apologies for the inconvenience. The tutorial text and project have since been updated and made consistent, so these issues should no longer be affecting you. If there are any other follow-up problems that occur as things are evolving, do let me know! Apologies again for any confusion that may have been caused by this!
I could not get the source code to compile from https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform/03_A_Simple_API_Server.
I'm a total n00b on kotlin, gradle and jvm for that matter, and I'm climbing the steep side of the mountain trying to run the tutorial in VS Code rather than IDEA. So I'm not claiming the tutorial code has a bug, when used as instructed, but when I:
... I get compilation errors
I fixed it by adjusting several of the
ktor
import paths, inserting .server (except forfeatures
, which I don't need yet and haven't figured out).Here's the updated file, working for me, FWIW:
It compiles and even responds "Hello, API!".
Proceed on through this very informative tutorial...