Hi, I get this error after adding the dependencies
build.gradle.kts
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
}
group "com.example"
version "1.0-SNAPSHOT"
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
kotlin {
js(IR) {
browser {
binaries.executable()
useCommonJs()
commonWebpackConfig {
cssSupport.enabled = true
}
testTask {
testLogging.showStandardStreams = true
useKarma {
useChromeHeadless()
useFirefox()
}
}
}
binaries.executable()
}
sourceSets {
val jsMain by getting {
dependencies {
implementation(compose.web.core)
implementation(compose.runtime)
// implementation(npm("bootstrap", "5.2.0"))
// implementation(npm("@popperjs/core", "2.11.5"))
implementation("app.softwork:bootstrap-compose:0.1.6")
implementation("app.softwork:bootstrap-compose-icons:0.1.6") // for icons support
implementation(devNpm("sass-loader", "^13.0.0"))
implementation(devNpm("sass", "^1.52.1"))
implementation(npm("material-components-web", "14.0.0"))
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
}
settings.gradle.kts
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
pluginManagement {
repositories {
google()
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "composeWeb"
Main.kt
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import app.softwork.bootstrapcompose.Alert
import app.softwork.bootstrapcompose.Color
import app.softwork.bootstrapcompose.require
import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.dom.*
import org.jetbrains.compose.web.renderComposable
import org.w3c.dom.HTMLElement
fun main() {
var count: Int by mutableStateOf(0)
require("./style.scss")
renderComposable(rootElementId = "root") {
Alert(Color.Primary) {
Text("Hello")
}
}
}
After removing the dependencies, the app work just fine