It seems that core-js npm bundle structure does no...
# javascript
a
It seems that core-js npm bundle structure does not correspond to the one promised in the documentation. Any ideas?
r
try adding manually core-js 3.2.1 to your project
a
Already done that. The problem is that
core-js
added via gradle/yarn is not the same
core-js
installed via npm. They have completely differen structure inside.
For now I've just copied one from system-wide node-modules to project build node-modules and everything started to work properly
It seems like it installs old version on
core-js
even when I explicitely ask for newer version.
s
Can you please show your
package.json
and
yarn.lock
in
build/js
?
a
Will do first thing in the morning.
🙏 1
Here they are. The error is reproducing in this configuration
The actually loaded version is
2.6.9
s
You have 2 versions of core-js: 3.2.1 and 2.6.9 3.2.1 is local to your
dataforge-vis-dataforge-vis-common
, so it is visible only inside this module. Seems like it version should be used for
kotlin-extensions
also, but
kotlin-extension
is in top level, so for this module core-js is resolved to
2.6.9
. It could be fixed by putting
"core-js": "3.2.1"
in `kotlin-extension`'s
package.json
or by using https://yarnpkg.com/lang/en/docs/selective-version-resolutions/ (you may put
"resolutions": { "kotlin-extension/core-js":"3.2.1" }
) in root
package.json
. Unfortunately it is not possible since both files will be overwriten in next build. I thinks we should fix
kotlin-extension
publication. Will take a look
a
It seems a bit strange since I do not use
core-js
directly. It is used internally by
kotlin-extension
. If it has wrong configuration, it should fail to build. By the way, the module itself should be supported better or even included in stdlib. I has a lot of useful things. It uses only one function from core-js. Maybe it is better to rewrite it in kotlin?
s
since I do not use
core-js
directly.
You have
api(npm("core-js"))
in https://github.com/mipt-npm/dataforge-vis/blob/9f157a80b9352631e423507bf16d714618d2560d/dataforge-vis-common/build.gradle.kts#L23 If you remove this line, only one version will remain, but it comes from babel and karma, not kotlin-extension. So, yes, the root bug is that kotlin-extension is not published correctly.
a
I have it because it does not work without it. Sadly, it does not work with it either.