Skip to content

The auto-reload glue is not added if index.html has no body #1012

@udoprog

Description

@udoprog

I was trying to troubleshoot while my page was not auto-reloading, and I eventually traced it down to this piece of code:

"body",

Since my index.html looked like this:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <link data-trunk rel="rust" href="Cargo.toml" />
        <link data-trunk rel="scss" href="style/style.scss" />
        <link data-trunk rel="copy-dir" href="/assets/"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <base data-trunk-public-url />
        <title>Hello World</title>
    </head>
</html>

The "body" selector couldn't find anything to append to, and the autoreloading glue is not injected.

I think it might be nice if trunk either emits a warning, errors, or simply adds a body in case it's missing.

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