Skip to content

Disabled labs error message is incorrect #10875

@vikaspotluri123

Description

@vikaspotluri123

Situation:

  • Trying to use get helper
  • [probably] have not specified API version in package.json
  • Disabled v0.1 Public API in labs

In this situation, html should be output that writes an error to the console. What's happening instead is the function signature (i.e. Function.toString) is the only html that's sent. I'm guessing this might have happened when express-hbs was bumped to v2, but there are plenty of other possible causes. I think the fix is just resolving with the error text rather than a function that returns the error text.

Relevant source:

errString = new SafeString(
'<script>console.error("' + _.values(errDetails).join(' ') + '");</script>'
);
if (options.async) {
return Promise.resolve(function asyncError() {
return errString;
});
}

Originally reported at the forum. Ghost version in page source was 2.25.x, running on Ghost (Pro).

Output screenshot (rendered to visitor):

image

HTML output snippet:

    </section> 
function asyncError() {
            return errString;
        }
  	<section>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[triage] something behaving unexpectedly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions