We have a kotlin-js project where we have a kotlin...
# javascript
m
We have a kotlin-js project where we have a kotlin-react dependency:
Copy code
implementation "org.jetbrains:kotlin-react-dom:16.13.1-pre.112-kotlin-1.4.0"
Looking in the build folder, my
yarn.lock
contains:
Copy code
react-dom@^16.13.1:
  version "16.14.0"
Looking into the node-modules, the version in
<Project>\build\js\node_modules\react-dom\package.json
is
16.14.0
- so everything is working just as expected. Then I add an npm dependency to a plain Javascript module, where the
package.json
contains a dependency on `"react-dom": "^15.3.2"`:
Copy code
implementation npm("js-module", "1.0.0")
Now my
yarn.lock
contains both of these:
Copy code
react-dom@^15.3.2:
  version "15.7.0"
  
react-dom@^16.13.1:
  version "16.14.0"
Looking into the node modules, the version in
<Project>\build\js\node_modules\react-dom\package.json
is
15.7.0
. This causes problems because we use React 16 features, which are missing in 15. Is this the expected behaviour? Are there any ways to control such dependency resolutions?
r
Since Kotlin 1.4.20 selective yarn dependency resolutions are supported: https://kotlinlang.org/docs/reference/whatsnew1420.html#gradle-dsl-changes
t
It looks like a bug Simple workaround - directly add
react-dom
dependency with valid version cc @Ilya Goncharov [JB]