# Error message when trying to create a post or page

**URL:** https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920
**Category:** WordPress
**Created:** [December 10, 2020, 8:25pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920 "2020-12-10T20:25:51Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 10, 2020, 8:25pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/1 "2020-12-10T20:25:51Z")

</div>

I’m getting an error message when I try to create a new post or page…

```
TypeError: Cannot read property ‘split’ of undefined
at DiscourseSidebar.buildPostState (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1211:41)
at DiscourseSidebar.initializePostState (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1192:43)
at new DiscourseSidebar (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1124:29)
at Ag (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:63:107)
at Vg (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:89:442)
at ph (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:217:70)
at lh (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409)
at O (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71)
at ze (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14)
at https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 10, 2020, 11:32pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/2 "2020-12-10T23:32:08Z")

</div>

Thanks, this one will be resolved when this is merged

[https://github.com/discourse/wp-discourse/pull/381](https://github.com/discourse/wp-discourse/pull/381)

cc @simon

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [December 11, 2020, 12:52am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/3 "2020-12-11T00:52:09Z")

</div>

Thanks Angus! Your changes have been merged into [WP Discourse](https://github.com/discourse/wp-discourse) 2.2.0. That version of the plugin is available in the WordPress plugin repo now.

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 11, 2020, 2:25pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/4 "2020-12-11T14:25:28Z")

</div>

Thank you so much! Confirmed this has resolved the issue.

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 21, 2020, 3:49pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/5 "2020-12-21T15:49:44Z")

</div>

Issue with this error is happening again. Getting the same error when trying to edit posts/pages.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 22, 2020, 12:29am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/6 "2020-12-22T00:29:50Z")

</div>

Hey Phillip, I can’t reproduce this one. Can you confirm

1. The exception message (the text in the console)
2. Which version of the plugin you’re using
3. Which version of wordpress you’re using
4. Which editor you’re using (Gutenberg or Classic)

Thanks mate.

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 22, 2020, 2:06pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/7 "2020-12-22T14:06:14Z")

</div>

- Here is the exception message…  
TypeError: Cannot read property ‘split’ of undefined  
at DiscourseSidebar.buildPostState (index.js:694)  
at DiscourseSidebar.initializePostState (index.js:675)  
at new DiscourseSidebar (index.js:606)  
at Ag (react-dom.min.js?ver=16.9.0:63)  
at Vg (react-dom.min.js?ver=16.9.0:89)  
at ph (react-dom.min.js?ver=16.9.0:217)  
at lh (react-dom.min.js?ver=16.9.0:126)  
at O (react-dom.min.js?ver=16.9.0:121)  
at ze (react-dom.min.js?ver=16.9.0:118)  
at react-dom.min.js?ver=16.9.0:53
- Plugin version is 2.2.0
- WP version 5.5.3
- Error occurs in both Classic and Gutenberg editors.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 23, 2020, 12:40am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/8 "2020-12-23T00:40:49Z")

</div>

Could you also share the value of the setting “Post Types to Publish” in “Publishing”? (take a screenshot of the setting if possible).

I’ll push a fix for this shortly so you can use the plugin again, but the reason I need to know a bit more (and the reason this is not appearing elsewhere) is that the immediate issue is indicative of another issue, and the immeidate band aid will obscure that other issue.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 23, 2020, 1:34am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/9 "2020-12-23T01:34:16Z")

</div>

@alchemyandaim There’s a PR open to fix the immediate issue: [Ensure topic tags is defined by angusmcleod · Pull Request #386 · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/pull/386). In addition to sharing the “Post Types to Publish” setting could you clarify something for me?

> [@alchemyandaim](#):
>
> Error occurs in both Classic and Gutenberg editors.

It’s not possible to get the exception you’ve quoted in the classic editor (the relevant code isn’t loaded in the classic editor at all). Are you sure you’re seeing an error in the classic editor? If so could you share that error?

The classic editor is the one that looks like this

 ![Screen Shot 2020-12-23 at 9.33.40 AM](https://global.discourse-cdn.com/meta/original/3X/9/d/9d661a05296ebc91388f6c4cdb78c3292a33eeed.png)

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 23, 2020, 1:49am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/10 "2020-12-23T01:49:29Z")

</div>

Here is the screen shot you requested.

 ![Screen Shot 2020-12-22 at 8.42.51 PM](https://global.discourse-cdn.com/meta/original/3X/c/d/cd4449d12ae704a7d35ba54d476a8525189ac6e4.png)

Also I did just verify that the problem occurs in only Gutenberg editor. Classic is okay.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 23, 2020, 2:08am UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/11 "2020-12-23T02:08:39Z")

</div>

Thanks. And you’re only seeing the exception occur when attempting to edit normal wordpress posts? Does it occur when you’re attempting to

- create posts?
- create pages?
- edit pages?
- when you’re creating or editing anything else?

Thanks for your help on this. I’d like to get to the bottom of it, as opposed to just applying the band aid (which we will also do shortly) as that’ll make for greater stability over the long term.

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 23, 2020, 12:54pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/12 "2020-12-23T12:54:32Z")

</div>

Error occurs when creating or editing pages only. Posts are fine.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [December 23, 2020, 6:10pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/13 "2020-12-23T18:10:13Z")

</div>

> [@angus](#):
>
> There’s a PR open to fix the immediate issue: [Ensure topic tags is defined by angusmcleod · Pull Request #386 · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/pull/386)

Thanks Angus! The PR has been merged into the master branch and pushed to the WordPress plugin repo.

@alchemyandaim, updating to [WP Discourse](https://github.com/discourse/wp-discourse) 2.2.1 from your WordPress dashboard should fix the issue for you.

---

<div class="post-metadata">

### Author: ![alchemyandaim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alchemyandaim/32/202967_2.png) [@alchemyandaim](https://meta.discourse.org/u/alchemyandaim)
#### Post date: [December 23, 2020, 6:51pm UTC](https://meta.discourse.org/t/error-message-when-trying-to-create-a-post-or-page/172920/14 "2020-12-23T18:51:34Z")

</div>

@simon @angus  
Confirmed this fixed the issue! thanks guys and happy holidays!
