我试图为Kotlin多平台项目配置一个模板,在后端运行ktor,在前端配置react,使用jetbrains团队的Kotlin类型安全包装器。要在前端和后端之间共享代码,我需要使用gradle
build.gradle.kts
val kotlin_version: String by project
val ktor_version: String by project
val logback_version: String by project
val annotations_version: String by project
val kotlin_react_version: S
我的问题是如何在KotlinJS中创建javascript结构并使用它们调用外部模块。假设我们有以下js代码,我们希望将其转换为KotlinJS。
const config = {
defs : "something",
resolvers : {
Query: {
books: () => []
}}
};
myFunction(config) // This can be any kind of external js function that accepts the above structure
我们如何使用Kotlin JS来表示上面的配置结
我有一个带有JVM和JS的Kotlin多平台项目。当执行jsRun gradle任务来启动webpack服务器时,它会失败,出现以下错误:
Waiting for changes to input files of tasks... (ctrl-d then enter to exit)
[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
at Command.<anon
我刚开始用世博来开发一个应用程序时,我发现应用程序开发显然有两种不同的方法。
如果我跑:
expo init test
它提示如下:
Choose a template: (Use arrow keys)
----- Managed workflow -----
❯ blank minimal dependencies to run and an empty root component
tabs several example screens and tabs using react-navigation
----- Bare workflow ---
我已经建立了一个Kotlin项目,使用Qunit进行测试,根据这个博客文章:,希望在我公司的主要软件上实现。
未明错误:错误加载模块'myapp_test‘。没有找到它的依赖性'kotlin-test‘。请检查“kotlin-test”是否在myapp_test之前加载。
是我试着运行测试时的错误。这让我很困惑。在我看来,“考特林测试”应该是事先装好的,但我想不是吗?我遗漏了什么?这是我的build.gradle文件..。
group 'com.example'
version '1.0-SNAPSHOT'
buildscript {
ext.
我正在尝试构建由IntelliJ IDEA生成的JS客户端和JVM服务器kotlin项目。获取错误: [...]\node_modules\.bin\webpack:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list 发现这是Windows上npm和webpack的常见问题,可以通过编辑package.json文件来修复。Webpack unable to bun
我正在开发一个SPA与Kotlin (Ktor)在后端。现在的项目结构是:
.
├── frontend/ <-- SPA frontend source project
│ ├── dist/ <-- current webpack dist
│ ├── node_modules/ <-- not to be included in the jar
│ ├── src/ <-- to be bundled by webpack
│ │ └──
我正在使用Google Charts和Kotlin JS创建交互式信息图表。这是来自的代码片段。
var data = new google.visualization.DataTable();
<..>
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
这里使用了"new“关键字。我试着用Kotlin重写这段代码。
val data = google.visualization.DataTable();
<..>
val ch
我编写了一个Kotlin/JS程序,在一些JavaScript引擎上崩溃。
它像这样在GraalVM上崩溃了:
RangeError: Maximum call stack size exceeded
at <js> 839(myprogram.js:394:1174923-1174934)
at <js> e(myprogram.js:394:1175309-1175342)
at <js> 724(myprogram.js:394:1174990-1174995)
at <js> e(myprogram.js:
我有一个Kotlin多平台设置,包括JS和Java部分。在common文件夹中,我编写了几个应该编译成js的方法。例如: class test {
init {
println("this is completely working")
}
} 现在,当我构建我的项目时,在JS-exclusive文件夹中生成了一个node_modules文件夹,其中包含上面的示例(尽管我希望Kotlin将println转换为console.log,但实际上并没有)。现在,我想包含这个文件及其方法,以便从另一个JS文件中读取。如何做到这一点呢?不幸的是,关于
我正在尝试一个使用binance和cctx的简单交易机器人
当我使用node index.js运行脚本时
我得到了这个长错误:
internal/modules/cjs/loader.js:323
throw err;
^
Error: Cannot find module '/home/ether/Documents/nodesendeth/node_modules/cctx/index.js'. Please verify that the package.json has a valid "main" entry
at t