Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.13 fails with new JS plugin #57

Closed
altavir opened this issue Jul 27, 2019 · 8 comments
Closed

0.1.13 fails with new JS plugin #57

altavir opened this issue Jul 27, 2019 · 8 comments

Comments

@altavir
Copy link

altavir commented Jul 27, 2019

ERROR in .._imported/kotlinx-io/0.1.13/kotlinx-io.js
Module not found: Error: Can't resolve 'text-encoding' in 'D:\Work\Projects\dataforge-core\build\js\packages_imported\kotlinx-io\0.1.13'
@JesseCorbett
Copy link

I'm running into this issue as well. It's resulting in ktor-js being entirely unusable for me. Any odds we can see this issue addressed soon?

@altavir
Copy link
Author

altavir commented Sep 10, 2019

The workaround is to add api(npm("text-encoding")) to JS platform dependencies. It gives a warning about unmaintained dependency, but works.

@Ribesg
Copy link

Ribesg commented Oct 1, 2019

Just encountered this as well!

@dhakehurst
Copy link

me too.
Thanks to @altavir for the work-around tip.
I find that I solved this in two parts,
for the browser,
add to package.json

"browser": {
    "text-encoding": false,
    "ws": false,
    "fs": false,
    "path": false,
    "os": false,
    "crypto": false,
    "stream": false,
    "http": false,
    "tls": false,
    "zlib": false,
    "https": false,
    "net": false
  }

then for the tests (which fail also with this problem)

kotlin {
    sourceSets {
        val jsTest by getting {
            dependencies {
                api(npm("text-encoding"))
            }
        }
    }
}

@gincwang
Copy link

Hello I'm trying to add this to my gradle (in groovy) but it's not recognizing the npm command, is that another plugin we have to add? Could not get unknown property 'npm' for object of type org.jetbrains.kotlin.gradle.plugin.mpp.DefaultKotlinDependencyHandler

@gincwang
Copy link

nvm I got it working with this syntax for groovy

jsMain {
    dependencies {
        implementation npm("text-encoding", 0.7.0)
    }
}

@joffrey-bion
Copy link

joffrey-bion commented Apr 18, 2020

I had the same issue and added the npm() dependency. It solved the problem, but the warning is a bit annoying.

I actually found out that my own mutliplatform libraries don't publish their npm dependencies either, and require the users to add the npm dependencies to their gradle files just like this.

Is it a gradle plugin issue or should it be fixed in the library?
Any idea how this should be fixed on library side?

gumil added a commit to gumil/talan that referenced this issue Jun 24, 2020
Text-encoding is a dependency from kotlinx-io
Kotlin/kotlinx-io#57
@fzhinkin
Copy link
Collaborator

We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants