if I’m using Kotlin/JS (1.9.0-RC) to create a site...
# javascript
a
if I’m using Kotlin/JS (1.9.0-RC) to create a site and I’ve got an
index.html
that includes my project’s .js file, is it expected that I have to manually define all dependencies, otherwise I get an error? This is the error I get in the browser console when I run
./gradlew jsBrowserRun
and open
localhost:8080
Copy code
Uncaught Error: Error loading module 'my-cool-site'. Its dependency 'kotlinx-html' was not found. Please, check whether 'kotlinx-html' is loaded prior to 'my-cool-site'.
I have to fix it by manually including all dependencies with script tags
Copy code
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello, Kotlin/JS!</title>
</head>
<body>

</body>
<script src="kotlin-kotlin-stdlib-js-ir.js"></script>
<script src="kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js"></script>
<script src="kotlinx-serialization-kotlinx-serialization-core-js-ir.js"></script>
<script src="kotlinx-serialization-kotlinx-serialization-json-js-ir.js"></script>
<script src="okio-parent-okio-js-ir.js"></script>
<script src="kotlinx-html.js"></script>
<script src="my-cool-lib.js"></script>
</html>
a
@Ilya Goncharov [JB], is it true? Shouldn't webpack handle it?
i
Usually webpack has to preapre full bundle with all dependencies included. So it is not expected. Could you please share your project?
1
a