Adam S
06/26/2023, 4:52 PMindex.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
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
<!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>
Artem Kobzar
06/27/2023, 9:13 AMIlya Goncharov [JB]
06/27/2023, 10:47 AMAdam S
06/27/2023, 6:05 PM