Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported zoneId illegalstateexception in wasm target #469

Open
brendanw opened this issue Jan 2, 2025 · 3 comments · May be fixed by #470
Open

Unsupported zoneId illegalstateexception in wasm target #469

brendanw opened this issue Jan 2, 2025 · 3 comments · May be fixed by #470

Comments

@brendanw
Copy link

brendanw commented Jan 2, 2025

IllegalTimeZoneException: JsException: unsupported ZoneId:Europe/Zurich

I am seeing this error when calling

TimeZone.of("Europe/Zurich")

The README says to include the below dependency to enable timezones for wasm+wasi

kotlin {
    sourceSets {
        val wasmWasiMain by getting {
            dependencies {
                implementation("kotlinx-datetime-zoneinfo", "2024a-spi.0.6.0-RC.2")
            }
        }
    }
}

I cannot find any referenced to a published version of kotlinx-datetime-zoneinfo on the internet. Gradle builds fail when trying to include this dependency.

@fzhinkin
Copy link
Contributor

fzhinkin commented Jan 2, 2025

@brendanw, TZ support for Wasm WASI is not released yet: #454 (comment)

@fzhinkin fzhinkin closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
@brendanw
Copy link
Author

brendanw commented Jan 2, 2025

@fzhinkin What about wasm targets?

@fzhinkin fzhinkin reopened this Jan 3, 2025
@fzhinkin
Copy link
Contributor

fzhinkin commented Jan 3, 2025

@brendanw for Wasm JS, the same js-joda workaround needs to be applied as for the regular JS target (except JsNonModule annotation should be omitted for WasmJS): https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#note-about-time-zones-in-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants