https://kotlinlang.org logo
#npm-publish
Title
# npm-publish
m

Mark Vogel

02/25/2023, 12:56 AM
I'm having an issue that every time I build I get the error:
Copy code
Could not determine the dependencies of task ':multiplatform:assembleJsPackage'.
> Cannot query the value of this provider because it has no value available.
I've narrowed it down to
npmPublish
, if I remove the plugin the issue goes away (but then I can't do what I need) It seems to possibly has something to do with the
binaries.library()
vs
binaries.executable()
. Is there something I'm obviously doing wrong? Appreciate the help!
👀 1
b

Big Chungus

02/25/2023, 9:01 AM
Can you share your gradle buildfile?
Regarding binaries, the plugin should not do anything for targets that are either using LEGACY compiler or binaries.executable()
m

Mark Vogel

02/25/2023, 7:14 PM
@Big Chungus thanks for the reply Here's my build file: https://pastebin.com/dmL9nG7P I get a different issue if I use
binaries.library()
that seems either unrelated to npmPublish or could be something to do with a combination of maven-publish and npmPublish on the library project. That error is here: https://pastebin.com/4vKFMLN9 It goes away if I remove my dependency on the other project or if I change to
binaries.executable()
(which then presents this issue). If, however, I change it to
binaries.executable()
, then I get the error I posted in my initial message which does go away if I remove npmPublish as a plugin. This may be a non-issue I guess as probably I can't use an executable as a library in JS
b

Big Chungus

02/25/2023, 7:18 PM
Weird, is the project oss so I could have a look? Otherwise could you create a reproducer for me?
Nothing appears to be wrong in your buildfile so far (other than binaries.executable(), but even that should not produce an error).
In the meantime, what npm-publish and kotlin plugin versions are you using?
m

Mark Vogel

02/27/2023, 3:41 PM
Sorry for the late reply. To reproduce that error simply create a new Kotlin Multiplatform project in IntelliJ (Full Stack Web Application) and use this build file. It's definitely just an incompatibility with npmPublish and the
binaries.executable()
. If I change it back to
binaries.library()
then it works with the exception of the other error I've been unable to solve; that's definitely more complicated. The version of npmPublish is 3.2.1 (or 3.2.0 which behave the same) and Kotlin 1.8.10 or 1.8.0
I did just publish my
common
project without npmPublish enabled and attempted to rebuild again and it seems the error persists. That means the main issue is not caused by npmPublish and the only incompatibility is with the executable which I'm assuming is expected except that it shouldn't prevent building or give a more useful error
b

Big Chungus

02/27/2023, 4:04 PM
Thanks. Yes, npm-publish should completely ignore targets with binaries.executable(). Looks like that's currently not the case and needs to be fixed.
12 Views