'Undefined' post content ghost installation

Hi, I’m running Ghost on my own server : https://blog.felixdavid.com/

Every post is displaying ‘Undefined’ when I click on them, while the overview is working.

I’m running the 2.23.1 version of Ghost, on Ubuntu Server 18.04 with Firefox. No error in the console.

Thank you !

Hi @Felix_David. It seems like you are using a custom theme on your blog and my suspicion is there might be an error (e.g. referencing wrong post field) in the post.hbs template :thinking:

Can you describe your setup a little more?

Hi @naz. It’s not linked to the theme, I’ve put the default casper back and it’s the same. You can have a look if you want.

Is there anything in the post’s content? Can you also check what is saved for those posts in the db?

Yes there is something in the post content you can read on the front page, it’s displayed correctly.

I’d be glad to check that for you, but I have no idea how to do that.

What’s shown on the index page comes from an excerpt field which is calculated differently than html which is shown on the post page itself.

What kind of setup are you using for your Ghost instance? What’s the database you are using? Does the problem stay the same when you add a new post with content in it?

Would be very helpful to have step-by-step instructions to reproduce this state :slight_smile:

I’m very new to ghost, then I followed this tutorial: How to install & setup Ghost on Ubuntu 20.04 or 22.04

At the end, I had Bad Gateway from nginx, then I did the

ghost update --force

and I could access my blog. But there was this ‘Undefined’ issue from the begging.

The posts you’re seeing are the very first ones, I didn’t write anything else.
I installed the following theme : GitHub - curiositry/mnml-ghost-theme: A minimal, responsive, fast Ghost 5.0 blog theme with great typography. Comes with paid membership support, Disqus comments, syntax highlighting, and KaTeX for mathematics, and more.

Here are my debug informations:

Debug Information:
OS: Ubuntu, v18.04
Node Version: v8.14.1
Ghost-CLI Version: 1.10.1
Environment: production
Command: ‘ghost doctor’

Hi @naz, any idea about what’s going on ? Do you need me to provide something else ?

Hey @Felix_David. Did you try creating new posts? It’s hard to tell what’s wrong without having very clear reproducible steps. So far it seems like there’s something wrong with data itself. You could see what data is in your posts by logging into your mysql instance and doing select * from posts.

Hey @naz, here is my output from mysql:

Thank you for helping !

Nothing particular with this data. Hm… The place that renders undefined for you is this line - Casper/post.hbs at main · TryGhost/Casper · GitHub, which is a content helper doing some manipulations on post’s html data. The data passed into this helper is populated through internal API call to Content API and for some reason the html property is not present at all (which renders as undefined). When you upload a theme which API version is it set to (can be checked in theme’s package.json ‘engines’ section like here)?

Sorry, it’s quite hard to debug this problem without being able to reproduce it on local environment :( Did you try reproducing same steps on local intallation for example?

Hi,

I updated today, and now it works…
Cannot explain that.

Hello their having somewhat the same problem I updated the ghost version to 2.25.3

and now i am getting this error

all tough my content api is working and giving data in json

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.