HTML encoding issue in emails (&nbsp, &amp, etc)

Hi Guys,

i have Ghost Version: 5.108.1

And it seems that e-mails are adding   See the below screen shots.


Best,

1 Like

How are you hosting your site? The reason I ask is because this is similar to a problem we’ve seen before when Ghost’s npm dependencies haven’t been installed as expected and the versions don’t match the ones that Ghost is built against.

1 Like

Hi @Kevin, thanks for the update, I host it on digital ocean, I ll update it.

How did you install and what’s your update process? Are you running any customisations?

I’ve been testing a new self-hosted setup on a Hostinger VPS, and it’s been challenging since Hostinger doesn’t seem to utilise Ghost CLI in its install, but the latest issue I’ve encountered in testing my emails through Mailgun is that Ghost is inserting random text gibberish into the HTML.

It’s also seeming to struggle with ampersands and other unicode symbols, as use of them appears to populate in text artefacts. Does anyone know what the issue might be? The test emails are delivered with no issue, and look just like this.

Everything in my Ghost config is up to date, production version 5.108.1. My About Ghost section is saying “Ghost is currently unable to send mail”, but I know that’s not true, since it’s successfully sent a few emails already. Would appreciate any help!

Apparently someone at Reddit has figured out what the issue is: Reddit - Dive into anything

The issue is in the way Ghost is “packaged”. An upstream dependency for the editor has been updated and is not compatible with other stuff anymore (simplified). The solution is to make sure the yarn.lock file is used for the build process.

Can anyone even begin to explain how I go about solving this?

(Aside: Merging these two topics since they look to be about the same issue.)

I’m a Hostinger fan, but not a fan of pre-built setups there or on Digital Ocean, because they tend to do some non-standard stuff that makes debugging tough, and you just don’t know what they’ve done. If you aren’t very far into using Ghost, you may want to consider restarting from a “plain” Ubuntu 22 install, and working through the install directions, including using the Ghost CLI. That should produce an install that works, and if it doesn’t, at least you’ll be using the “standard” setup and getting help will be easier! :)

That’s @jannis - hey Jannis, if you know which package might need to have its version pinned, that’d be great knowledge to capture here. :slight_smile:

1 Like

Quite honestly, not sure which package it was. The key issue was that the yarn.lock file, which does pin packages correctly, was not included in the build process. This happened both on Magic Pages, Ghost(Pro), and later on, on DigitalPress.

So, assumption: Hostinger is also ignoring the yarn.lock file. @ohyeahpaulchin, if you’re relying on their pre-built version, there isn’t really anything you can do about it. As Cathy pointed out, starting from scratch with the Ghost CLI would be the better option (and – if it is the same issue – has not been affected by this, when it first occurred in October 2024).

@jeremielondon, since this might also affect your hosting at Abstract27, these are the steps I took to include the yarn.lock:

  1. I run yarn archive on the Ghost repository to get the package
  2. Extract it
  3. Add the original yarn.lock file into it
  4. Repackage it
  5. Then use the Ghost CLI with --archive to install this newly packaged archive

I do all of this in a custom Dockerfile, so no manual intervention needed.

3 Likes

@jannis @Cathy_Sarisky @Kevin , All good for now. Thanks a lot for the help :+1:

1 Like

Possibly related: Email formatting includes visible HTML entities · Issue #22064 · TryGhost/Ghost · GitHub

1 Like

Hey everyone,

After further investigation, we’ve identified that the yarn.lock file is missing in Ghost release v5.108.1. This is likely the cause of the issue. Therefore, we have deprecated Ghost release v5.108.1.

We’re working on a fix and will post an update as soon as we make progress. In the meantime, we recommend downgrading to the previous Ghost version, v5.107.2.

We’re really sorry for the inconvenience and appreciate your patience while we get this sorted!

Sag

2 Likes

Hey everyone - we’ve just published v5.108.2, which includes the yarn.lock file. We’ve also tightened up our internal release scripts to avoid this in the future.

Please update to that version using Ghost-CLI :slightly_smiling_face:

3 Likes

MOD NOTE: Merging two threads to tidy up. Any discontinuities are probably my fault. --Cathy

Hi,

I use Ghost on my website Linux Handbook. I self host it using DigitalOcean and I have been sending email nesletters for more than 3 years.

Today, when I sent the latest newsletter (displayed fine on the web), I saw that it was showing strange characters in Gmail (yes, I receive my own newsletter):

It should have looked like this:

They are everywhere:

I wonder what character sequence I used to trigger this rendering issue.

Anyone else faced same issue?
Any suggestions on it?

1 Like

Hey @Abhishek_Prakash,

Possibly the same issue as being discussed in HTML encoding issue in emails (&nbsp, &amp, etc)

1 Like

Thanks @Sag

Yes, it seems to be the same issue. Let me see how I can fix it.

For anyone reading this thread, as a temporary measure, I downgraded my Ghost deployment to the earlier version I was using with this command (run it in the directory where Ghost is located):

ghost update --rollback

This will give me a breather to either wait for the fix to be released by involved parties or work on a solution of my own.

Hey,

After further investigation, we’ve identified that the yarn.lock file is missing in Ghost release v5.108.1. This is likely the cause of the issue. Therefore, we have deprecated Ghost release v5.108.1.

We’re working on a fix and will post an update as soon as we make progress. In the meantime, we recommend downgrading to the previous Ghost version, v5.107.2.

We’re really sorry for the inconvenience and appreciate your patience while we get this sorted!

Sag

2 Likes

That is excellent news. Thank you @Sag

I can still see it under the release tag. I wanted to update my Ghost version urgently because I am being bombard with spam member sign ups.