Function asyncError() { return errString; } When attempting to retrieve posts

Hey, I’m trying to loop through posts on a static homepage that I have as home.hbs. I’m calling
{{#get "posts"}}
{{#foreach posts}}
<p>meep</p>
{{/foreach}}
{{/get}}

It’s giving me this error:

function asyncError() { return errString; }

You can see this homepage at https://coopermor.ghost.io/

Here’s a screenshot of the code that’s returning that error:

I’m using the most recent version of Ghost 2. Any ideas? Thanks!

Have you enabled the v2 content api in your package.json script (engines.ghost-api)?

My guess is you’re getting the error because the v0.1 public API is disabled (which is the default in Ghost 2.x). It looks like you’ve found a bug in Ghost, where the function is printed rather than the error :slight_smile:

Spot on - on that did the trick, thanks Vikas :slight_smile:

1 Like