# Blank website after update

**URL:** https://meta.discourse.org/t/blank-website-after-update/161759
**Category:** Support
**Created:** [August 22, 2020, 1:59pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759 "2020-08-22T13:59:31Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 22, 2020, 1:59pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/1 "2020-08-22T13:59:31Z")

</div>

Hi,

I just updated our [Discourse Forum](https://forum.humancoders.com/) and it’s now blank (homepage and admin). The HTML looks OK, RSS are working.

I found JS errors due to our theme. Can the problem come from here?  
 ![Capture d’écran 2020-08-22 à 15.57.03](https://global.discourse-cdn.com/meta/original/3X/9/f/9f378f10491067b0edd7f1db8b6c512b94fa1130.png)

How can I fix that? Can I modify/disable the JS code of my theme from CLI? Install a new theme?

Edit: I’ve no other theme installed, so i can’t use `?preview_theme_id=`

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 22, 2020, 3:37pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/2 "2020-08-22T15:37:06Z")

</div>

Hey @CamilleRoux

You can also change the default theme directly in the DB with SQL, if you are comfortable with direct DB queries.

HTH

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 22, 2020, 3:39pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/3 "2020-08-22T15:39:58Z")

</div>

Did you try [How to use Discourse Safe Mode](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)?

---

<div class="post-metadata">

### Author: ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)
#### Post date: [August 22, 2020, 3:46pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/4 "2020-08-22T15:46:10Z")

</div>

What are you doing 🤔 ?

- Check [safe mode](https://meta.discourse.org/t/53504?silent=true): `https://forum.humancoders.com/?safe_mode=no_custom%2Cno_plugins%2Conly_official`

- Logs `https://forum.humancoders.com/logs` (private ?)

Try via SHH run this:

```plaintext
cd /var/discourse
git pull
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 22, 2020, 4:44pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/5 "2020-08-22T16:44:17Z")

</div>

> [@pfaffman](#):
>
> Did you try [How to use Discourse Safe Mode](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)?

The [safe mode](https://meta.discourse.org/t/53504?silent=true) is not working… same error:

```
ReferenceError: Discourse is not defined
    at https://forum.humancoders.com/assets/start-discourse-efa4e5abfbd1b50b5152ffbe64d5dcea9f7c33f766dcc6387e2711f0f2112148.js:1:1

```

> [@SidV](#):
>
> Try via SHH run this:

I already did a rebuild `./launcher rebuild app`

> [@neounix](#):
>
> You can also change the default theme directly in the DB with SQL, if you are comfortable with direct DB queries.

I haven’t other themes installed, so I should install a new theme with CLI or modify the existing one. I don’t know how to do that

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 22, 2020, 4:59pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/6 "2020-08-22T16:59:50Z")

</div>

OH, so your default theme has broken stuff in it, so there’s no way to disable it? If that’s what happened, then that’s why you want to always put those customizations in theme components (thought this isn’t a helpful time to tell you that!). (But I’m not entirely sure that’s the case).

And you have no 3rd party plugins?

I guess what you need to do, maybe, is at the rails console, create a new empty theme, and then change the default to the new theme. I don’t know, offhand, just how to do that.

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 22, 2020, 5:22pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/7 "2020-08-22T17:22:16Z")

</div>

I’m not totally sure yet that the problem come from the theme.  
But if it’s the case, yes, creating an empty theme and set it by default could solve the problem. I don’t know how to do that ☹

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 22, 2020, 6:39pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/8 "2020-08-22T18:39:06Z")

</div>

> [@CamilleRoux](#):
>
> I’m not totally sure yet that the problem come from the theme.

Me neither. 🤷‍♂️

> [@CamilleRoux](#):
>
> I don’t know how to do that

Me neither. I think I could figure it out, but I’ve got a bunch of paying work that I’m trying not to do on a weekend.

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 23, 2020, 6:56am UTC](https://meta.discourse.org/t/blank-website-after-update/161759/9 "2020-08-23T06:56:13Z")

</div>

Hi @CamilleRoux

I just checked your site for you by setting the UA string in the dev console to Google bot. This will display the Rails only site without the Ember SPA.

You can see that you site is “OK” from a Rails perspective, so this indicates your container is running fine and, as you have guessed, you have a Javascript issue in your theme (component).

See attached:

 ![Screen Shot 2020-08-23 at 1.53.41 PM](https://global.discourse-cdn.com/meta/original/3X/e/5/e57b2de023aa0ef8663d6a7c67cc6ff8c3707bf9.jpeg)

@CamilleRoux

Can you get to a psql prompt (or use the rails console if you like) and run these queries:

### Let’s check to see how many themes you have installed:

```plaintext
discourse=# select count(*) from themes;
 count 
-------
    22
(1 row)

```

### Let’s check to see what is your default theme id (currently):

```plaintext
discourse=# select value from site_settings where name = 'default_theme_id';
 value 
-------
 3
(1 row)

```

### Also, can you run this as well?

```plaintext
discourse=# select id, name, component, enabled from themes;
 id | name | component | enabled 
----+---------------------------+-----------+---------
  3 | Light | f | t
  6 | Minima | f | t
  7 | Hamburger Theme Selector | t | t
  2 | Material Dark | f | t
  8 | Vincent | f | t
  5 | Material | f | t
  9 | Simple | f | t
 10 | Graceful Wide | f | t
 11 | Dark Wide | f | t
 14 | Alien Night | f | t
 39 | md-composer-extras-neo | t | t
 40 | Plugin Outlets | t | f
 15 | User Card Directory | t | f
 41 | Raw Post Button | t | t
  4 | Graceful | f | t
  1 | Dark for GSE | f | t
 42 | Dark | f | t
 43 | discourse gifs | t | t
 44 | Cookie Consent Banner | t | t
 46 | Graceful Edits | t | t
 45 | Neo Stuff Scratch Sheets | t | t
 48 | Unformatted Code Detector | t | t

```

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 23, 2020, 7:23am UTC](https://meta.discourse.org/t/blank-website-after-update/161759/10 "2020-08-23T07:23:10Z")

</div>

OBTW,

@CamilleRoux

I just tested this for you.

After you run the queries in my post above to list all your themes (and you have a record of the current state of your themes), assuming you can get to your DB and run this query, either rails or from psql; you can try this:

### Query to disable all theme components

```plaintext
discourse=# update themes set enabled = false where component = true;

```

This query above will turn off all your theme components.

Then you can see “what happens” when you try to access your broken site.

> If I was in your current situation, based on checking your site as a bot UA, I would turn off all theme components.

_Actually, I would turn them off one at a time, starting with any theme component related to nav links (see JS error below ,as a starting place); because I am comfortable and experienced with direct SQL DB queries. Do you have strong SQL skills?_

If you are not comfortable with this, you can message me and give me access and I will help you get past this “not so good situation” you are in. I am pretty sure, based on the info I have at this time, I can help you get up and running again 🙂

> **See also your JS error:**
>
> ```plaintext
> Discourse.ExternalNavItem=Discourse.NavItem.extend({href:function(){return this.get('href');}.property('href')});I18n.translations.fr.js.filters.formations={title:"Formations",help:"Formations pour développeur·se·s"};Discourse.NavItem.reopenClass({buildList:function(category,args){var list=this._super(category,args);list.push(Discourse.ExternalNavItem.create({href:'https://www.humancoders.com/',name:'formations'}));return list;}});jQuery(function($){$(document).on("ready",function(){if(Cookies.get('hcFirstPage')==undefined){$(document).on('click','.toggle-menu',function(e){e.preventDefault();$('.main-nav').toggleClass('show');});var tweenBounce=TweenMax.to('#topbar',1.2,{maxHeight:"50px",delay:2,ease:Power1.easeInOut});var tweenBounceBack=TweenMax.to('#topbar',1.2,{maxHeight:"4px",delay:5.5,ease:Power1.easeInOut});Cookies.set('hcFirstPage',true,{expires:.04});}else{var tweenBounce=TweenMax.to('#topbar',0);}
> window.addEventListener('unload',function(){Cookies.remove('hcFirstPage');});var tweenOpen,tweenClose;$('.topbar-toggle').on('mouseenter',function(){tweenBounce.kill();tweenOpen=TweenMax.to('#topbar',.4,{maxHeight:"50px",ease:Power1.easeInOut});});$('#topbar-zone-click').on('mouseenter',function(){tweenBounce.kill();tweenOpen=TweenMax.to('#topbar',.4,{maxHeight:"50px",ease:Power1.easeInOut});});$('#topbar').on('mouseenter',function(){tweenBounce.kill();tweenOpen=TweenMax.to('#topbar',.4,{maxHeight:"50px",ease:Power1.easeInOut});});$('#topbar-zone-click').on('mouseleave',function(){tweenOpen.kill();tweenClose=TweenMax.to('#topbar',.4,{maxHeight:"4px",ease:Power1.easeInOut});});$('.topbar-toggle').on('mouseleave',function(){tweenOpen.kill();tweenClose=TweenMax.to('#topbar',.4,{maxHeight:"4px",ease:Power1.easeInOut});});$('#topbar').on('mouseleave',function(){tweenOpen.kill();tweenClose=TweenMax.to('#topbar',.4,{maxHeight:"4px",ease:Power1.easeInOut});});});});
> 
> ```

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 23, 2020, 3:03pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/11 "2020-08-23T15:03:01Z")

</div>

OK thank you falks for your help.  
It’s an old install and I had no other theme/component install. So you couldn’t change my theme or disable all the component.  
So I restored an old backup, updated my theme, then updated Discourse. It’s better, but I still have one error (out of 2 before).

Here is the error:

```
Uncaught ReferenceError: Discourse is not defined
<anonymous> /assets/start-discourse-efa4e5abfbd1b50b5152ffbe64d5dcea9f7c33f766dcc6387e2711f0f2112148.js:1

```

Here is what contains this file:

```
Discourse.start();

```

Do I have an old version of the default theme? (the current theme was created in 2016 by just adding some CSS and JS to the default theme)

PS : The website is running again because I’m using the backup without updating Discourse.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 23, 2020, 3:07pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/12 "2020-08-23T15:07:29Z")

</div>

> [@CamilleRoux](#):
>
> The website is running again because I’m using the backup without updating Discourse.

Then I think what I’d do is create a new generic theme and make it the default, then do the upgrade and fix up your theme.

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 26, 2020, 3:30pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/13 "2020-08-26T15:30:09Z")

</div>

Little update: I’ve the bug on some versions of Discourse but not all.  
It’s working correctly on `stable` and `tests-passed` but not on `beta`. So I admit the bug has been already fixed but not commited to beta.

> [@CamilleRoux](#):
>
> Here is the error:
> 
> ```plaintext
> Uncaught ReferenceError: Discourse is not defined
> <anonymous> /assets/start-discourse-efa4e5abfbd1b50b5152ffbe64d5dcea9f7c33f766dcc6387e2711f0f2112148.js:1
> 
> ```
> 
> Here is what contains this file:
> 
> ```plaintext
> Discourse.start();
> 
> ```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 26, 2020, 5:24pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/14 "2020-08-26T17:24:47Z")

</div>

> [@CamilleRoux](#):
>
> So I admit the bug has been already fixed but not commited to beta.

But the problem with your theme customization or a default one?

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [August 26, 2020, 10:40pm UTC](https://meta.discourse.org/t/blank-website-after-update/161759/15 "2020-08-26T22:40:06Z")

</div>

With the current beta, I have the same bug whatever the theme.
