Nicodemus Ojwee
09/03/2020, 9:02 PMimplementation("org.jetbrains:kotlin-extensions:1.0.1-pre.112-kotlin-1.4.0")
Throws the error below:
Unable to resolve "kotlin-wrappers-kotlin-react-jsLegacy" from "shared/build/js/packages/shared/kotlin/shared.js"
I don't quite understand why the jsLegacy is part of the module name. I expected the module to be kotlin-extensions as in version 1.3.72?Jorrit
09/04/2020, 7:47 AMJoost Klitsie
09/04/2020, 8:00 AMspand
09/04/2020, 10:40 AMpostdist
script that it cannot find mkdirp
which is included as a devdependency. We have seen other errors also like npm modules failing their postinstall
script that cannot find node
when they try to node -e "Please donate..."
I dont understand how this can be related to the java version but its the only differencedarkmoon_uk
09/05/2020, 2:25 PMlouiscad
09/06/2020, 1:11 AMPlease choose a JavaScript environment to build distributions and run tests.
Not choosing any of them will be an error in the future releases.
kotlin {
js {
// To build distributions for and run tests on browser or Node.js use one or both of:
browser()
nodejs()
}
}
The problem is that whenever I try to replace js()
or js { useCommonJs() }
with js(BOTH) { nodejs(); browser() }
, I get that error on build:
Could not create an instance of type org.jetbrains.kotlin.gradle.targets.js.subtargets.KotlinNodeJs.
> Failed to apply plugin [class 'org.gradle.language.base.plugins.LifecycleBasePlugin']
> Cannot add task 'clean' as a task with that name already exists.
I'm a little surprised the recommendation doesn't work… what could be wrong here, and is there workarounds?gaetan
09/07/2020, 8:44 AMBearDev
09/07/2020, 1:19 PMUncaught ReferenceError: window is not defined
at universalModuleDefinition:10
at workerLocal.js:15
I understand that window is not a defined object in a web worker context, and my own code avoids using it. But the module loader seems to try to access it. This was not an issue with 1.3.72, and I hope there are some config options I could tweak to get it to work. Hope I can get some help on this as I dont know how to proceed on my on my own.Franco
09/08/2020, 9:42 AM@file:JsModule("react-gtm-module")
@file:Suppress("unused")
package react.gtm
external object TagManager {
fun initialize(args: TagManagerArgs)
}
but when I run it I get the error Uncaught TypeError: Cannot read property 'initialize' of undefined
. Any idea what I'm doing wrong?stephanmg
09/08/2020, 10:16 AMDmitry Romanov [JB]
09/08/2020, 3:29 PMDmitry Romanov [JB]
09/08/2020, 3:31 PMDmitry Romanov [JB]
09/08/2020, 3:33 PMspierce7
09/09/2020, 11:15 PMiBehnia
09/10/2020, 11:29 AMspierce7
09/11/2020, 4:59 AMimport Observable
import Subscriber
Nicodemus Ojwee
09/12/2020, 9:54 PMdata class Test(var name: String = "", var age: Int = 0)
val output = JSON.stringify(Test("Nico", 25))
Output i get:
{name: "Nico", age: 25}
The output i expected:
{
"name": "Nico",
"age": 25
}
Aren't the keys supposed to be in double quotes as above compared to the first output?dan.the.man
09/14/2020, 5:25 PM@OptIn(ExperimentalJsExport::class)
@JsExport
class TestClass(val hello:String)
And I'm just seeing an empty build/js/packages/mypackage/kotlin folder
js(IR) {
browser {
testTask {
useKarma {
useChromeHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
binaries.executable()
}
is the portion in my build.gradlebashor
09/14/2020, 6:54 PMdan.the.man
09/15/2020, 2:33 PMExported declaration uses non-exportable property type: List<Carousel>
and
data class Data(
val carousel:List<Carousel>
)
Carousel itself is marked with @JsExport as well, am I not able to export lists?Max
09/15/2020, 8:13 PMJosh Feinberg
09/16/2020, 3:50 AMModule parse failed: Unexpected token (10:29)
File was processed with these loaders:
* ../../node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.googling states it might be babel problem so i tried adding it as a loader
config.module.rules.push({
test: /\.extension$/,
loader: 'babel-loader'
});
config.module.rules.push({
test: /\.extension$/,
loader: 'ts-loader'
});but still no luck. anyone have any thoughts? (using the multiplatform plugin if that matters)
Daniele B
09/16/2020, 9:36 PMViewModel
is written in Kotlin MultiPlatform
and shared across all platforms, while the UI is platform-specific declarative
.
I am using JetpackCompose on Android, SwiftUI on iOS, and I am trying to understand what is the most suitable framework for the Web.
I am considering React
and Vue.js
.
As you can understand, I am interested in a lightweight framework which can behave just as JetpackCompose and SwiftUI.
This means that I don't need to use any data manipulation or networking capability, as these functionalities are already managed by the Kotlin ViewModel.
Some of the characteristics I am looking for are:
- simplicity of routing
- speed
- quality and variety of UI components
- ease to create simple custom components
What do you think it's better between React and Vue.js for this kind of lightweight declarativeUI usage?
In this context, what are the advantages of React over Vue.js, and of Vue.js over React?spierce7
09/17/2020, 4:46 AMNicodemus Ojwee
09/17/2020, 12:39 PMval (myValue, setMyValue) = useState(Int.MAX_VALUE)
When i use an Int as below:
val (myValue, setMyValue) = useState(Int)
I get an error when trying to access or pass myValue to a function that requires an Int saying:
Type mismatch: Required Int, Found Int.Companion
Can someone help me explain why this is happening and what those two mean?Daniele B
09/17/2020, 1:09 PMCannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-js:1.4.10 because no repositories are defined.
In my gradle.build.kts file, I actually have not even specified the version:
implementation(kotlin("stdlib-js"))
how can I fix this issue?zeugederunity
09/18/2020, 6:30 AMGlobalScope.launch{}
via the componentDidMount
while loading a child-component.
In 1.3.72 it worked like a charmer, are there any known bugs in 1.4.10 that i missed?romainbsl
09/18/2020, 9:08 AMLEGACY
/ IR
/ BOTH
directly in the KotlinTarget ? I need this, as I’m using a custom Gradle plugin, thus js(compiler)
or gradle.properties are not possiblemkosm
09/18/2020, 9:08 AM@file:JsQualifier("cast.framework.events")
@JsName("EventType")
external enum class PlayerEventType {
// ...
}
This is because it generates the following line in JavaScript:
var EventType = cast.framework.events.EventType;
However, in that scope, cast
is a function generated by Kotlin (seems to be from the serialization library):
function cast(_this_) {
return isInterface(_this_, KSerializer) ? _this_ : THROW_CCE();
}
This results in the following error:
Uncaught TypeError: Cannot read property 'events' of undefined
Any workaround?romainbsl
09/18/2020, 11:47 AM> Task :kodein-di:compileTestDevelopmentExecutableKotlinJsIr FAILED
e: java.lang.AssertionError: org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl@f80d1cf8: No such type argument slot: 0