Site broken due to ember 5 upgrade

WAY TOO SOON!

I completely missed the announcement of this change because it got mixed with the winter holidays, and as a hobbyist I don’t read this forum very regularly. I only noticed once today’s update broke the site. Now I don’t have a way to go back because EMBER_VERSION is already disabled, and I don’t have a way forward to fix whatever needs to be fixed because I cannot see the deprecation warnings (which didn’t show up last time I had to do active maintenance, before the holidays), not that I know much about Ember anyway.

This is seriously making me consider extracting the database and moving to a different forum solution, one where the default version is actually safe to use for hobbyists that can’t watch the dev forums like a hawk.

Can anyone think of another solution, given that I have no idea what is breaking Ember 5 or why? Javascript console is unhelpful.

2 Likes

Actually the javascript console is usually very helpful.

Perhaps you might have preferred stable but its a bit late now, I appreciate.

I suggest removing all your customisations, and perhaps using a staging instance, putting them all back one by one and working out which are causing the issues and either drop those, or work on them.

Many popular plugins and Theme Components are already compliant.

2 Likes

It just says “Ember not found”, screen is an endless loading icon.

I installed the default, standard Digital Ocean version of Discourse. At no point was I asked which branch I want, and I assumed that would put me on an LTS version. Having a breaking feature pushed out and then made required all within 2 months is NOT what I consider LTS; in Wordpress or Linux you wouldn’t even do that for non-LTS releases. Please change this for all new DigitalOcean droplets and put a warning that hobbyists should keep away.

You are going to hate this answer, but DO does what DO wants and it is out of others’ hands. So you should ask that from them.

And everywhere outside DigitalOcean is always warned not to use theirs install.

3 Likes

From the error in the console, you can usually figure out from what theme component the error has been emitted. Can you paste the whole error here (expanding the error), or if it’s possible, would you mind sharing your forum URL here (or by PM if you prefer)?

3 Likes

You need to have a word with DO then :slight_smile:

That said, in the standard install (not DO’s version) tests-passed (the default) is not LTS, stable is. I believe CDCK try to encourage this default because it leverages the community to test the latest version. I think that’s reasonable payback for getting free software? But you have the choice.

2 Likes

safe-mode might help. Perhaps you can just disable the themes that are broken.

I see that I did something for you some years ago. I was going to see if I could find a quick fix, but I don’t have an account on your site anymore.

3 Likes

Safe mode should work, regardless, have you tried that, then you can isolate the problem theme or plugin

It is very hard to help without any extra information

What themes are you using? What plugins? Which one is broken?

3 Likes

Hi @Judith

I’m really sorry this has taken you by surprise. :cry: I’ve split this out into its own dedicated topic so we can concentrate on getting you back up and running again.

Have you made any progress? :crossed_fingers:

3 Likes

Thanks everyone!

I have identified the broken plugins as the ones responsible for sending Discourse push notifications to iphones (where the standard Discourse way doesn’t work), namely @featheredtoast’s GitHub - featheredtoast/discourse-pushover-notifications: Pushover notifications for Discourse as well as my GitHub - Sprachprofi/discourse-fcm-notifications: Send Discourse push notifications through FCM to any custom app . The Ember code is identical in both of them and very simple, just a couple extra fields in the admin and one extra field in the user profile, with checks on whether push notifications are already active or not. Given that the retirement of the EMBER_VERSION switch means I cannot see any deprecation warnings or error messages that might help me narrow down which of those few lines is a problem, I asked Github Copilot for advice on what might have changed between Ember 3 and Ember 5 and I’m trying those suggestions. If you have ideas, I’m all ears.

Let me just reiterate that this is not how a breaking change should be pushed and I am deeply disappointed with Discourse. Several policies that go against all wisdom:

  • putting non-technical people on the tests-passed rather than LTS version by default
  • compounding this by not even mentioning the possibility of putting oneself on a more stable version in the official installation guide; it is only known to forum insiders who presumably have less need of it
  • making reversion to an earlier, working version impossible
  • compounding this by also guaranteeing the backward compatibility of the project is less than two months, through deliberate removal of the EMBER_VERSION flag. Other projects have backward compatibility of a year, and those are projects where it’s also possible to revert to older versions.
1 Like

For your own plugin, I think the (only?) problem is that you’re using an Ember global

export default Ember.Component.extend({

which should be refactored to

import Component from "@ember/component";
export default Component.extend({

(It would be even better to refactor it to class syntax but that’s not necessary to get your site back up and running)

ChatGPT is capable of spotting things like this, by the way.

3 Likes

Yup, I agree with @RGJ. Based on the ‘Ember not found’ error mentioned above, the most likely issue is the ‘ember-global’ deprecation. More details on that here (linked from the original announcement). In these plugins, it looks like that’s being used for Ember.Component, and also for some Ember.computed.* calls.

Here are a couple of quick PRs. It’s possible there are other issues which will reveal themselves after this fix is made, but I don’t see anything obvious skimming through the JS code.

Thanks for the feedback on the rollout process! We’re constantly working to strike the right balance between progress and stability. We’ll definitely be taking what we’ve learned from this rollout and apply it to future upgrade/refactoring projects.

9 Likes

Thanks @david ! I have deactivated Pushover Notifications for now in order to reduce the error space and pulled in the latest version of the Discourse FCM Notifications plugin, but a new build still gives me “Ember not defined” error.

Fwiw, the Copilot suggestion was:

The part about set / setProperties seems to be wrong - I checked these functions still exist in Ember 5. Also changing this._super to super didn’t work, gave an error message during compile. The computed syntax has also changed now, it is currently neither the original nor the one Copilot recommended. So I’m fresh out of ideas what else may have changed in Ember 5. I don’t use Ember in any of my other projects.

Any more ideas?

2 Likes

So sorry, that’s my bad - I missed a spot :facepalm:. This should do it: Fixup Ember.Component usage by davidtaylorhq · Pull Request #2 · Sprachprofi/discourse-fcm-notifications · GitHub

Yeah I think AI can have trouble differentiating between non-essential new patterns (things like native class syntax, this.set/get, etc.) and essential deprecation fixes. The AI suggestions can still be useful, but only if you have enough context to know what to trust/ignore.

Personally, I would always go to an authoritative source like https://deprecations.emberjs.com/v3.x first.

6 Likes

The site is back up now! Thank you so much for helping me fix this in real time!!! I really appreciate it.

@featheredtoast please also accept the pull request so that forums using Pushover notifications are also safe to update.

4 Likes

Pushover notification patches are also merged as of today :white_check_mark:

8 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.