`build/js/packages_imported/ktor-ktor-client-core/...
# javascript
g
build/js/packages_imported/ktor-ktor-client-core/1.3.0/ktor-ktor-client-core.js
Module not found: Error: Can't resolve 'abort-controller' in 'build\js\packages_imported\ktor-ktor-client-core\1.3.0'
build/js/packages_imported/ktor-ktor-io/1.3.0/ktor-ktor-io.js
Module not found: Error: Can't resolve 'text-encoding' in 'build\js\packages_imported\ktor-ktor-io\1.3.0'
I'm having these errors in the browser console of my KotlinJS project. I'm not using ktor as a direct dependency - I use a kotlin multiplatform library which uses ktor. I've had the same errors when developing the aforementioned library, and after adding jsMain npm dependencies in the library's build gradle file like this:
Copy code
api(npm("text-encoding"))
api(npm("abort-controller"))
the errors dissapeared from the library. However, they still do exist in my KotlinJS project which uses this library. What could be the issue here?
i
Hi, now when you publish your Kotlin/JS library, information about its npm dependencies doesn’t publish to module. So your project doesn’t know about these dependencies. There is the way to save information about npm dependencies, you can add file
package.json
with declared dependencies to your publication. When we import Kotlin/JS library, we check existence of
package.json
inside and consider declared dependencies in it.
g
Thanks, will try this out