When using `kotlinx-datetime` on Kotlin/JS on Wind...
# kotlinx-datetime
r
When using
kotlinx-datetime
on Kotlin/JS on Windows I have a strange problem with casing. There is a webpack warning and the library is not working correctly (
ClassCastException
is thrown):
Copy code
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:

    javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\Kotlin-DateTime-library-kotlinx-datetime\kotlinx\datetime\serializers\LocalTimeSerializers.mjs Used by 1 module(s), i. e. javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\Kotlin-DateTime-library-kotlinx-datetime\kotlinx\datetime\localtime.mjs
    javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\kotlin-datetime-library-kotlinx-datetime\kotlinx\datetime\serializers\LocalTimeSerializers.mjs Used by 1 module(s), i. e. javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\kotlin-datetime-library-kotlinx-datetime\kotlinx\datetime\localtime.mjs
The project builds and works fine on Linux (but what is strange I have two directories inside
build/js/packages/wykaz/kotlin
-
Kotlin-DateTime-library-kotlinx-datetime
and
kotlin-datetime-library-kotlinx-datetime
with different content).
the problem reveals itself only when using
kotlin.js.ir.output.granularity=per-file
d
If you could provide a project where this issue reproduces, I'll look into it. This is the first time I'm hearing about such a problem!
r
I'll try to simplify my project to prepare a reproducer
I'm not able to create a simple reproducer with errors (class cast exceptions). It doesn't work in our large, closed source application, but it works with simple apps. But it's easy to reproduce webpack warnings about casing. Should I open an issue about that?
d
An issue report for the Kotlin compiler (kotl.in/issue) would be nice, thanks.