Skip to content

Enabling minify results in cryptic warning message, no minification. #1044

Open

Description

@mcclure

Repro: Within a larger workspace, I create a small, simple wasm app based on the Yew "Hello World" tutorial.
You can find the code here:
https://codeberg.org/mcc/rs-bug/src/commit/19b82401a9d15fb4c3384bac34ead9439a1804b7

The Trunk.toml contains filehash = false, inject_scripts = false, minify = "on_release". There is no JavaScript in the project other than what Trunk generates. I have trunk 0.21.14 and rustc 1.90.0 (1159e78c4 2025-09-14).

I build with (cd client && trunk build --release).

Observed behavior: During trunk build, this is printed:

WARN Failed to minify JS: RequiredTokenNotFound(Identifier) [token=Some(KeywordDefault)]

And the generated client.js is not minified.

Expected behavior (preferred): A minified projecntame-client.js is generated.

Expected behavior (minimum): If minified JS cannot be generated, a clear error/warning message should explain what to do about it.

Notes: I find there is a discussion about this in this issue two weeks ago. Another user hit the same issue and believes it is due to this bug on the minify helper app. Someone named @neon-mmd is undertaking a fork of the minifier, but I'm not sure how to track that work or how that fix gets fed back into trunk (EG I don't know if neon-mmd is affiliated with Trunk or what). Because issue 810 is fundamentally unrelated, I think there should be a standalone issue for tracking this work with regard to its impact on Trunk.

Activity

  1. alisterd51 commented on Feb 25, 2026

    @alisterd51
    Contributor

    This issue will be fixed after this MR is merged.
    I deliberately chose not to use the neon-mmd fork because it is a recent, vibecoded fork with little reputation (hence my migration to swc, which seems more solid to me).

  2. mcclure commented on Feb 25, 2026

    @mcclure
    Author

    Just want to say I very much appreciate you sparing my computer of LLM code

  3. Boscop commented on May 12, 2026

    @Boscop

    (I'm also encountering this.)

    Btw, #1041 is merged now

    Could we have a new Trunk release with this fix included? 🙏
    (The latest release 0.21.14 was a year ago)

  4. ctron commented on May 13, 2026

    @ctron
    Collaborator

    Yes, I think it makes sense having a release. But there already is a "beta" release: 0.22.0-beta.1 … that should allow you trying this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions