Title: Post Block: forever &#8220;loading&#8221;
Last modified: September 6, 2018

---

# Post Block: forever “loading”

 *  Resolved [philbee](https://wordpress.org/support/users/philbee/)
 * (@philbee)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/post-block-forever-loading/)
 * On 2 separate WP installs, one of which is _really_ basic, Post Block never actually
   finds any Posts, let alone Custom Post Types, to display; it simply stays in 
   the “loading” stage.
 * I see a “TypeError: undefined is not an object (evaluating ‘new wp.api.collections’)”
   error in the browser console, so maybe there’s something not working there?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [maximebj](https://wordpress.org/support/users/maximebj/)
 * (@maximebj)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/post-block-forever-loading/#post-10693652)
 * Thanks ! I’ll fix it this week. I had rewrote some chunk of code and fucked up
   something. I should test more…
 *  Plugin Author [maximebj](https://wordpress.org/support/users/maximebj/)
 * (@maximebj)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/post-block-forever-loading/#post-10704986)
 * Should be working in 1.4.2. I changed the way I call the WP API. Some of the 
   functions I used were deprecated.
 *  Thread Starter [philbee](https://wordpress.org/support/users/philbee/)
 * (@philbee)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/post-block-forever-loading/#post-10720506)
 * Nice work!
    Displaying Posts as Gutenberg blocks now works.
 * Also, I sometimes can find/select custom post types.
    “Sometimes” because the
   finding/selecting does not work reliably – I get “The editor has encountered 
   an unexpected error” (see error code at the bottom), even when I set the CPTs“
   show_in_rest” => true. Other CPTs have resulted in “This block has encountered
   an error and cannot be previewed.” error messages.
 * What is a little bit worrying though is that CPTs that seem to work in Gutenberg,
   displaying just fine in the Gutenberg editor with post image, title and text,
   simply disappear completely when viewing the post in the frontend.
 * (I’ve made some screenshots if that helps?)
 * Error message copied from “editor has encountered an unexpected error”:
 *     ```
       Sg@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:142:332
       m@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:12:390
       Xb@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:79:172
       https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:88:371
       rd@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:91:27
       O@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:90:457
       yh@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:104:146
       lg@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:120:90
       mg@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:120:388
       gc@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:127:204
       vb@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:126:232
       ub@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:126:67
       zd@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:124:451
       ra@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:123:321
       enqueueSetState@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:189:233
       setState@https://gutenberg.test/wp-content/plugins/gutenberg/vendor/react.min.ab6b06d4.js:18:456
   
       promiseReactionJob@[native code]
       ```
   
 *  [Rodrigo D’Agostino](https://wordpress.org/support/users/dt4ils/)
 * (@dt4ils)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/post-block-forever-loading/#post-10826587)
 * I’m still having the same issue here :S
    I’m using WP 4.9.8 and AGB 1.5, and 
   receiving the following console error messages:
    - GET [http://localhost/wp-json/wp/v2/posts/?search=test&per_page=20](http://localhost/wp-json/wp/v2/posts/?search=test&per_page=20)
      404 (Not Found) (anonymous) @ index.js?4d5c:44
    - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 
      0 at eval (index.js?4d5c:45)
 * This is probably due to having my WP installation in a local server, but it’s
   worth mentioning since it should be pointing to `http://localhost/wordpress` 
   instead of simply `http://localhost/`.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post Block: forever “loading”’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/advanced-gutenberg-blocks_333834.
   svg)
 * [Advanced Gutenberg Blocks](https://wordpress.org/plugins/advanced-gutenberg-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-gutenberg-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-gutenberg-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-gutenberg-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-gutenberg-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-gutenberg-blocks/reviews/)

## Tags

 * [post block](https://wordpress.org/support/topic-tag/post-block/)

 * 4 replies
 * 3 participants
 * Last reply from: [Rodrigo D’Agostino](https://wordpress.org/support/users/dt4ils/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/post-block-forever-loading/#post-10826587)
 * Status: resolved