Skip to content

WASM-bundle remediation message is wrong: BUNDLE_WASM is ignored, and kotlinWasmUpgradeYarnLock only exists with -Ptrailblaze.wasm=true #184

Description

@basementbot

Problem

When the uber JAR is built without the WASM report template (the dev default, trailblaze.wasm=false), report//devices rendering fails with:

WASM bundle not found. Rebuild with `-Ptrailblaze.wasm=true` (or `BUNDLE_WASM=true ./scripts/install-trailblaze-source.sh`) so the report template is bundled into the uber JAR.

Both remediations in that message are wrong / incomplete, so following them doesn't fix it:

  1. BUNDLE_WASM=true ./scripts/install-trailblaze-source.sh does nothing. The script doesn't read BUNDLE_WASM — it only honors TRAILBLAZE_GRADLE_EXTRA_ARGS (its own comment notes CI uses that to pass -Ptrailblaze.wasm=true). So BUNDLE_WASM=true ... builds without WASM and the error persists.

  2. The WASM build then fails on a stale yarn lock, whose own remediation is also a dead end without context:

    :kotlinWasmStoreYarnLock FAILED
    > Lock file was changed. Run the `kotlinWasmUpgradeYarnLock` task to actualize lock file
    

    But kotlinWasmUpgradeYarnLock only registers when -Ptrailblaze.wasm=true is set (the wasmJs target is conditional on the flag). Run bare, it's Task 'kotlinWasmUpgradeYarnLock' not found.

What actually works (verified end-to-end)

# 1. actualize the wasm yarn lock (task only exists with the flag)
./gradlew -Ptrailblaze.wasm=true kotlinWasmUpgradeYarnLock
# 2. build + install the uber JAR WITH the wasm flag
TRAILBLAZE_GRADLE_EXTRA_ARGS="-Ptrailblaze.wasm=true" ./scripts/install-trailblaze-source.sh

After that, /devices serves the real viewer instead of the error.

Suggested better message

WASM report template not bundled in this uber JAR (dev builds default to trailblaze.wasm=false for speed). To include it, rebuild with the WASM flag:
TRAILBLAZE_GRADLE_EXTRA_ARGS="-Ptrailblaze.wasm=true" ./scripts/install-trailblaze-source.sh
If the build fails on a stale yarn lock, first run:
./gradlew -Ptrailblaze.wasm=true kotlinWasmUpgradeYarnLock

i.e. drop the non-functional BUNDLE_WASM suggestion, and note the yarn-lock upgrade task needs the flag.

Environment

Trailblaze source build off main, macOS. Surfaced while bundling the report template into a source uber JAR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions