Skip to content

Error on a custom partial that was removed #570

Description

@moates

Error

Your theme has 1 error!
----

Important to fix, functionality may be degraded.        

- Error: Templates must contain valid Handlebars        

Details: Oops! You seemed to have used invalid Handlebars syntax. This mostly happens when you use a helper that is not supported.
See the full list of available helpers here (https://ghost.org/docs/themes/helpers/).

Affected Files:
index.hbs - The partial page-header could not be found  

Background

  1. Last week, I was using a custom partial page-header in some files without issue.
  2. Today, I realized I don't use the partial enough, so I deleted page-header.hbs and all references to the partial.
  3. Npm build and zip run without errors. My site seems as I expect it to.
  4. When I run gscan or upload my theme, gscan flags "index.hbs - The partial page-header could not be found." This is unexpected, as I've double-checked and there are no floating references to page-header in my code. I double-checked that I am on the correct branches & in the correct directories.

Expected Behvaior

No flags should be thrown for code that doesn't exit.

Is there some sort of caching or partials index that is being retained?

Index.hbs

{{!< default}}
<div class="gh-page">
    <div class="gh-container">
        <div class="gh-postfeed">
        {{#foreach posts}}
            {{> "card" page=../pagination.page }} {{!-- partials/card.hbs --}}
        {{/foreach}}
        </div>

        {{!-- If JS isn't enabled, fallback to standard pagination --}}
        <noscript>
            <div class="gh-pagination">
                {{pagination}}
            </div>
        </noscript>
    </div>
</div>

Environment

recent Windows, VSCode, gscan 4.43.1.
This issue reproduces on a local environment, on automatic uploads through GH Actions, and when manually uploading a fresh template zip to Ghost Pro.

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