Skip to content

A single quote in the mount prefix makes Vue pages fail to render #645

Open

Description

@JuroOravec

What happens

When the prefix passed to set_mounted_prefix() (or to an integration's mount()) contains a single quote, every page that has a Vue component fails to render with:

ValueError: Vue serialization hooks removed the required Citry runtime asset.

No serialization hook is involved. The runtime is still in the page, but the check that looks for it does not find it, because the two escape the quote differently: the runtime <script> tag is written by format_attrs, which writes ' as &#39;, while the check in citry/_vue/serialization.py searches for the URL escaped with html.escape(..., quote=True), which writes it as &#x27;.

Steps to reproduce

from citry import Citry, Component

app = Citry(autodiscover=False)
app.set_mounted_prefix("/ci'try")


class Page(Component):
    citry = app
    template = """
<!doctype html>
<html>
  <head></head>
  <body><p :title="label">ready</p></body>
</html>
"""

    def js_data(self, kwargs, slots):
        return {"label": "ready"}


Page().render().serialize()  # raises ValueError

Seen on Citry 0.8.0.

Expected

The page renders, or set_mounted_prefix() rejects the prefix with a clear message.

Notes

The sub-path an app is served below already handles this: normalize_sub_path() in citry/_sub_path.py percent-encodes ' for the same reason. The mount prefix could get the same treatment, or be checked against the characters a URL path may hold.

Activity

  1. added
    next-sprint
    on Nov 14, 2026
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

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions