Creating a KotlinJS application using GitHub Actions for continuous integration tasks

I am encountering some difficulties while trying to set up GitHub Actions for building my KotlinJS project. I have included the following JavaScript runtime dependency:

implementation(npm("kotlinx-serialization-kotlinx-serialization-core-jslegacy", "1.4.2-RC1"))

However, I am receiving an error message:

Module 'kotlinx-serialization-kotlinx-serialization-core-jsLegacy' not found 
> Task :remote:jsBrowserDevelopmentWebpack

Do I need to install npm or any other source in order to make this work with GitHub Actions? Or is there a specific GitHub Action that I should use for building KotlinJS projects on GitHub Actions? This is the link to my GitHub Actions YAML file - the JavaScript library is built and copied to a JAR as a resource: https://github.com/sentinelweb/cuer/blob/ab00c7a7cd969eafa72b0d28bc5ba5c5c3e099d3/.github/workflows/android.yml

Below is the dependency tree - when removing the jsMain dependency kotlinx-serialization-kotlinx-serialization-core-jslegacy, it leads to a runtime/webpack error. Therefore, I am unsure about how this dependency is created in the kjs runtime - perhaps it needs to be removed using another library. Simply removing it breaks the runtime/webpack component.

    val commonMain by getting {
            dependencies {
                implementation(project(":shared"))
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:$ver_kotlinx_datetime")
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$ver_kotlinx_serialization_core")
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$ver_kotlinx_serialization_core")
                implementation("io.ktor:ktor-client-core:$ver_ktor")
                implementation("io.insert-koin:koin-core:$ver_koin")
            }
        }

        val jsMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-datetime-js:$ver_kotlinx_datetime")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$ver_coroutines_core")
                implementation("org.jetbrains:kotlin-react:$ver_kotlin_react")
                implementation("org.jetbrains:kotlin-react-dom:$ver_kotlin_react")
                implementation("org.jetbrains:kotlin-styled:$ver_kotlin_styled")
                implementation(npm("react-youtube-lite", "1.0.1"))
                implementation(npm("react-share", "~4.2.1"))
                // todo shouldn't be need but breaks build runtime/webpack
                implementation(npm("kotlinx-serialization-kotlinx-serialization-core-jslegacy", "1.4.2-RC1"))

            }
        }

Answer №1

It appears that the issue stemmed from using an outdated version of the Kotlin-serialization dependency in Kotlin-datetime. Updating to kotlin-datetime 0.2.1 resolved the issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can I use npm's jQuery in an old-school HTML format?

I am looking to incorporate jQuery into a project without having to rely on the website or CDN for downloading the library. As someone new to npm, I am curious to know if following these steps would be advisable or potentially problematic down the line. Wh ...

utilize the Dbus library within an Electron application (Building process)

Encountering an issue when requiring DBus from the dbus package. const { app, BrowserWindow } = require("electron"); const DBus = require('dbus'); app.whenReady().then(() => { var win = new BrowserWindow({ width: 600, height: 50 ...

Encountering "npm WARN optional dep failed, proceeding with fsevents" error while attempting to install vue-cli on AWS/EC2 instance

I'm in the process of setting up vue-cli on AWS. Everything seems good with my permissions, and I have node v4.4.5 installed. Upon executing npm install --global vue-cli, the cursor flashes for approximately 30 seconds before displaying this error m ...

Storing Nodes Externally: A Guide to Dockerizing Node-Red with External Node

My current challenge involves installing numerous missing node-red nodes to a container. When I maintain the (named) container and execute it with docker start, everything functions smoothly. However, my goal is to store the installed nodes in a separate ...

The exit code 1 was triggered in the npm-lifecycleindex.js file at line 285,

0 silly lifecycle <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bac9ced5c8d194c9cadbfa8b948a948a">[email protected]</a>~build.prod: Args: [ '/d /s /c', 10 silly lifecycle 'gulp build.prod --color --en ...

Extracting dependencies with npm: A comprehensive guide

With the help of pip, one can easily export all dependencies by running: pip freeze > requirements.txt However, wondering if there is a similar function for npm packages? ...

Struggling with npm publish following the configuration of Azure Artifacts feed

I'm facing a problem with npm install and npm publish in my Node.js project after setting up authentication with an Azure Artifacts feed. I've followed the documentation and made the required changes to my user and project level .npmrc file http ...

The results of Angular CI tests vary between local environment and DevOps platform

I've encountered an issue with my pipeline. While I am aware that my current Karma tests are not working properly, there seems to be a discrepancy between running the tests on my local machine and on DevOps pipelines. karma.conf.ci.js // Configurat ...

Error Message: "Unable to locate module for Angular 5 UI Components packaging"

In the process of developing UI Components to be used in various web projects throughout the company, we are aiming to publish these components as an npm package on our local repository. It is crucial for us to include the sources for debugging purposes. F ...

Error: npx is unable to locate the module named 'webpack'

I'm currently experimenting with a customized Webpack setup. I recently came across the suggestion to use npx webpack instead of node ./node_modules/webpack/bin/webpack.js. However, I am encountering some difficulties getting it to function as expecte ...

Feeling perplexed about the installation of npm dependencies

I have two different versions of node.js/npm installed - one is 1.4.28 and the other is 3.1.0 When deploying the same application with a package.json file that includes: { "name": "server", "version": "0.0.1", "description": "JS server", "dep ...

Issue with Build System CTA's/Callback function functionality not operational

I have encountered an issue with my build/design system. Although everything works fine during development, when I publish my package and try to use the callback function, it does not return the necessary data for me to proceed to the next screen. I tried ...

Resolve an npm installation issue caused by error code EINTEGRITY

After reviewing numerous similar posts on this platform, I have yet to find a solution. Many suggest using npm cache verify or npm cache clear, but these haven't worked for me. I even took the extreme step of completely removing npm and node through ...

IDE cannot find imported modules even though the NPM Package is functioning correctly

Working with npm has been a great experience for me, and my first package is functioning perfectly. However, in my IDE (Webstorm), when I import my package, it shows a "Cannot resolve symbol" error (even though it works). Furthermore, when I use ...

Encountering a 404 error when trying to access assets on _next folder after

I have encountered an issue while trying to deploy my next app to gh pages. Only the index and 404 pages are displaying, while all other pages, images, js, and css files inside the _next folder are returning a 404 error. After conducting some research, I ...

Converting SVG with an external PNG file embedded into a standalone PNG format using Node

Does anyone know of a node package that can convert an svg file to a png, including external images embedded within the svg code like this? <?xml version="1.0" encoding="utf-8"?> <svg viewBox="0 0 120 120" height="120" width="120" xmlns="h ...

Finding it difficult to install the grpc-tools package using npm or yarn on a Mac M1 chip?

Steps for Installation: npm install -g grpc-tools yarn add global grpc-tools Encountered errors while attempting to install grpc-tools on Mac M1 Big Sur. The error messages are displayed below: npm ERR! code 1 npm ERR ...

Integrating eBay API with Node.js

Hello, I am new to Node.js and I could really use some assistance with exporting console log data to an HTML page. I came across a helpful example on GitHub at this link: https://github.com/benbuckman/nodejs-ebay-api My current issue is that although I h ...

What is the process of integrating Gulp into my project?

My current setup involves utilizing Windows 7 and Visual Studio 2013 as part of my Client's project. In an attempt to integrate Gulp into the project, I have included the following Nugets: - Node.js version 0.12.0 - Npm.js version 1.3.15.10 However, ...

Potree's point cloud viewer displays an empty screen

Currently, I am facing difficulties with the Potree viewer as I try to display one of the sample html files from the potree npm library. Running on npm version 8.19.2, I have installed potree version '0.1.0' using the command 'npm install po ...