Skip to content

[4.0.0-beta4] BUG: hx-prompt not working on Unicode input [error: String contains non ISO-8859-1 code point] #3841

Description

@YamiOdymel

#3828 adds hx-prompt back to HTMX 4 as an extension to fix #3825

I grabbed the extension directly from the pull request, but then I encountered an error with 4.0.0-beta4 if prompt contains Chinese character:

htmx: htmx:error: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point. TypeError: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.
    at #issueRequest (htmx.js:544:42)
    at #handleTriggerEvent (htmx.js:509:37)
    at htmx.js:343:51
    at inner (htmx.js:719:21)
    at spec.handler (htmx.js:769:21)
L544                 let response = await ctx.fetch(ctx.request.action, ctx.request);
L509                 await this.#issueRequest(ctx);
L343                 await this.#handleTriggerEvent(ctx);
L719                 handler(evt);
L769                 timed(evt);

This appears to be the same issue as #3781, but the comment mentioned that it was fixed in 4.0.0-beta3 🤔?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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