bod
02/20/2025, 2:51 PMkotlin-js-store/yarn.lock
generated on my project has the same dependency twice with 2 versions. Not sure if that's expected?
It doesn't seem to be a problem, except I'm getting this warning on every single build which is annoying:
Transitive npm dependency version clash for compilation "jsmain"
Candidates:
node-fetch@2.7.0
node-fetch@2.6.7
Selected:
node-fetch@2.7.0
Should I just edit manually yarn.lock and keep only the most recent one?Artem Kobzar
02/20/2025, 3:19 PMyarn-deduplicate
toolbod
02/20/2025, 3:39 PMArtem Kobzar
02/20/2025, 3:48 PMCLOVIS
02/20/2025, 7:46 PMbod
02/20/2025, 7:49 PMCLOVIS
02/20/2025, 7:50 PMbod
02/20/2025, 7:52 PMbod
02/20/2025, 7:53 PMCLOVIS
02/20/2025, 7:54 PMbod
02/20/2025, 7:54 PMEdoardo Luppi
02/21/2025, 8:26 AMbod
02/21/2025, 8:49 AMEdoardo Luppi
02/21/2025, 8:57 AMbod
02/21/2025, 8:58 AMMoritz Hofmeister
02/21/2025, 8:58 AMEdoardo Luppi
02/21/2025, 9:00 AMTbh I'm unsure of the implications thoughGood question. That's something to explore I guess. However when it comes down to the final bundles, the result should be the same. Package versions are pinned and thus the pulled npm files should be the same.
Edoardo Luppi
02/21/2025, 9:01 AMbod
02/21/2025, 9:03 AMLike, at some point you'll have to transition anyway. Yarn Classic is pretty much dead and that's why npm is there now.Thanks I didn't know about that!
Edoardo Luppi
02/21/2025, 9:06 AMEdoardo Luppi
02/21/2025, 9:12 AMbod
02/21/2025, 9:14 AMEdoardo Luppi
02/21/2025, 9:20 AMbod
02/21/2025, 9:21 AMMoritz Hofmeister
02/21/2025, 9:21 AMbod
02/21/2025, 9:22 AMEdoardo Luppi
02/21/2025, 9:27 AMbod
02/21/2025, 9:31 AMEdoardo Luppi
02/21/2025, 9:38 AMEdoardo Luppi
02/21/2025, 10:28 AMEdoardo Luppi
02/21/2025, 10:30 AMbod
02/21/2025, 10:33 AMEdoardo Luppi
02/21/2025, 10:38 AMimplementation(npm("node-fetch", "2.7.0"))
creates a strict dependency.
You need to use npm range notation to allow matching more versions, for example
implementation(npm("node-fetch", "^2.6.0"))
bod
02/21/2025, 10:42 AMEdoardo Luppi
02/21/2025, 10:44 AMbod
02/21/2025, 10:44 AMEdoardo Luppi
02/21/2025, 10:46 AMEdoardo Luppi
02/21/2025, 10:48 AMEdoardo Luppi
02/21/2025, 10:49 AMapollo = "4.1.1"
...
apollo-mockserver = "com.apollographql.mockserver:apollo-mockserver:0.1.0"
in the catalogbod
02/21/2025, 10:50 AMEdoardo Luppi
02/21/2025, 10:52 AMEdoardo Luppi
02/21/2025, 10:56 AMEdoardo Luppi
02/21/2025, 10:56 AMbod
02/21/2025, 10:58 AMbod
02/21/2025, 10:58 AMEdoardo Luppi
02/21/2025, 11:00 AMyarn-deduplicate
was indeed correct if you don't want to touch the version under Apollo.bod
02/21/2025, 11:01 AMEdoardo Luppi
02/21/2025, 11:01 AMbod
02/21/2025, 11:02 AMbod
02/21/2025, 11:04 AMEdoardo Luppi
02/21/2025, 11:10 AMbod
02/21/2025, 11:18 AMEdoardo Luppi
02/21/2025, 11:19 AMYou can also work with npm dependencies directly using the npm package manager instead. To use npm as your package manager, in your gradle.properties file, set the following property:
kotlin.js.yarn=false
Edoardo Luppi
02/21/2025, 11:20 AMbod
02/21/2025, 11:31 AMEdoardo Luppi
02/21/2025, 11:45 AMjs()
variant is a package.json
is bundled with the .klib
You can see that with Ktor's klib here.
The klib information is then extracted under build/js/packages_imported
as you can see in the screenshot, and referenced in build/js/package.json
through the npm workspaces
concept.
That's what I know about it.
Be it Yarn or npm, the resulting package.json
file should be no different.
However an official response is probably what you want so I'd say wait @Ilya Goncharov [JB] or @Artem Kobzar to answer that.