# Error occur when enable nest replies and post voting

**URL:** https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696
**Category:** Bug
**Tags:** post-voting, nested-replies
**Created:** [May 23, 2026, 2:15pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696 "2026-05-23T14:15:14Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![cuo\_wu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cuo_wu/32/498442_2.png) [@cuo\_wu](https://meta.discourse.org/u/cuo_wu)
#### Post date: [May 23, 2026, 2:15pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/1 "2026-05-23T14:15:14Z")

</div>

When I enable nest replies and post voting, and convert a post to nest replies view. I got 500 error.

```plaintext
NoMethodError (undefined method 'post_number' for nil) lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json' lib/nested_replies/post_tree_serializer.rb:2

```

```plaintext
NoMethodError (undefined method 'post_number' for nil)
lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json'
lib/nested_replies/post_tree_serializer.rb:20:in 'NestedReplies::PostTreeSerializer#serialize_topic'
app/services/nested_topic/list_roots.rb:124:in 'NestedTopic::ListRoots#enrich_with_topic_metadata'
lib/service/base/step.rb:43:in 'BasicObject#instance_exec'
lib/service/base/step.rb:43:in 'Service::Base::Step#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base/only_if_step.rb:19:in 'block in Service::Base::OnlyIfStep#run_step'
lib/service/base/only_if_step.rb:19:in 'Array#each'
lib/service/base/only_if_step.rb:19:in 'Service::Base::OnlyIfStep#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base.rb:260:in 'block in Service::Base#run!'
lib/service/base.rb:260:in 'Array#each'
lib/service/base.rb:260:in 'Service::Base#run!'
lib/service/base.rb:253:in 'Service::Base#run'
lib/service/base.rb:226:in 'Service::Base::ClassMethods#call'
lib/service/runner.rb:152:in 'Service::Runner#result'
lib/service/runner.rb:137:in 'Service::Runner#call'
lib/service/runner.rb:132:in 'Service::Runner.call'
lib/service/base.rb:227:in 'Service::Base::ClassMethods#call'
app/controllers/nested_topics_controller.rb:146:in 'NestedTopicsController#list_roots_response'
app/controllers/nested_topics_controller.rb:23:in 'NestedTopicsController#show'
app/controllers/application_controller.rb:452:in 'block in ApplicationController#with_resolved_locale'
app/controllers/application_controller.rb:452:in 'ApplicationController#with_resolved_locale'
app/controllers/application_controller.rb:1101:in 'ApplicationController#ensure_d...

```

```plaintext
plugins/discourse-post-voting/extensions/topic_view_extension.rb:88:in 'PostVoting::TopicViewExtension#next_page'
plugins/discourse-ai/lib/embeddings/entry_point.rb:41:in 'block (2 levels) in TopicViewSerializer#inject_into'
(eval at active_model_serializers-0.8.4/lib/active_model/serializer.rb:467):89:in 'TopicViewSerializer#_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in 'ActiveModel::Serializer#attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in 'ActiveModel::Serializer#_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in 'ActiveModel::Serializer#serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in 'ActiveModel::Serializer#as_json'
lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json'
lib/nested_replies/post_tree_serializer.rb:20:in 'NestedReplies::PostTreeSerializer#serialize_topic'
app/services/nested_topic/list_roots.rb:124:in 'NestedTopic::ListRoots#enrich_with_topic_metadata'
lib/service/base/step.rb:43:in 'BasicObject#instance_exec'
lib/service/base/step.rb:43:in 'Service::Base::Step#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base/only_if_step.rb:19:in 'block in Service::Base::OnlyIfStep#run_step'
lib/service/base/only_if_step.rb:19:in 'Array#each'
lib/service/base/only_if_step.rb:19:in 'Service::Base::OnlyIfStep#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base.rb:260:in 'block in Service::Base#run!'
lib/service/base.rb:260:in 'Array#each'
lib/service/base.rb:260:in 'Service::Base#run!'
lib/service/base.rb:253:in 'Service::Base#run'
<internal:kernel>:91:in 'Kernel#tap'
lib/service/base.rb:226:in 'Service::Base::ClassMethods#call'
lib/service/runner.rb:152:in 'Service::Runner#result'
lib/service/runner.rb:137:in 'Service::Runner#call'
lib/service/runner.rb:132:in 'Service::Runner.call'
lib/service/base.rb:227:in 'Service::Base::ClassMethods#call'
app/controllers/nested_topics_controller.rb:146:in 'NestedTopicsController#list_roots_response'
app/controllers/nested_topics_controller.rb:23:in 'NestedTopicsController#show'
actionpack (8.0.5) lib/action_controller/metal/basic_implicit_render.rb:8:in 'ActionController::BasicImplicitRender#send_action'
actionpack (8.0.5) lib/abstract_controller/base.rb:215:in 'AbstractController::Base#process_action'
actionpack (8.0.5) lib/action_controller/metal/rendering.rb:193:in 'ActionController::Rendering#process_action'
actionpack (8.0.5) lib/abstract_controller/callbacks.rb:261:in 'block in AbstractController::Callbacks#process_action'
activesupport (8.0.5) lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:452:in 'block in ApplicationController#with_resolved_locale'
i18n (1.14.8) lib/i18n.rb:354:in 'I18n::Base#with_locale'
app/controllers/application_controller.rb:452:in 'ApplicationController#with_resolved_locale'
activesupport (8.0.5) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:1101:in 'ApplicationController#ensure_dont_cache_page'
activesupport (8.0.5) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
activesupport (8.0.5) lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.5) lib/abstract_controller/callbacks.rb:260:in 'AbstractController::Callbacks#process_action'
actionpack (8.0.5) lib/action_controller/metal/rescue.rb:27:in 'ActionController::Rescue#process_action'
actionpack (8.0.5) lib/action_controller/metal/instrumentation.rb:76:in 'block in ActionController::Instrumentation#process_action'
activesupport (8.0.5) lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'
activesupport (8.0.5) lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
activesupport (8.0.5) lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
actionpack (8.0.5) lib/action_controller/metal/instrumentation.rb:75:in 'ActionController::Instrumentation#process_action'
actionpack (8.0.5) lib/action_controller/metal/params_wrapper.rb:259:in 'ActionController::ParamsWrapper#process_action'
activerecord (8.0.5) lib/active_record/railties/controller_runtime.rb:39:in 'ActiveRecord::Railties::ControllerRuntime#process_action'
actionpack (8.0.5) lib/abstract_controller/base.rb:152:in 'AbstractController::Base#process'
actionview (8.0.5) lib/action_view/rendering.rb:40:in 'ActionView::Rendering#process'
rack-mini-profiler (4.0.1) lib/mini_profiler/profiling_methods.rb:90:in 'block in ActionController::Base#profile_method' 
actionpack (8.0.5) lib/action_controller/metal.rb:252:in 'ActionController::Metal#dispatch'
actionpack (8.0.5) lib/action_controller/metal.rb:335:in 'ActionController::Metal.dispatch'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:67:in 'ActionDispatch::Routing::RouteSet::Dispatcher#dispatch'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:50:in 'ActionDispatch::Routing::RouteSet::Dispatcher#serve'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:53:in 'block in ActionDispatch::Journey::Router#serve'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:133:in 'block in ActionDispatch::Journey::Router#find_routes'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:126:in 'Array#each'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:126:in 'ActionDispatch::Journey::Router#find_routes'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:34:in 'ActionDispatch::Journey::Router#serve'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:908:in 'ActionDispatch::Routing::RouteSet#call'
lib/middleware/omniauth_bypass_middleware.rb:35:in 'Middleware::OmniauthBypassMiddleware#call'
lib/middleware/crawler_hooks.rb:13:in 'Middleware::CrawlerHooks#call'
rack (2.2.23) lib/rack/tempfile_reaper.rb:15:in 'Rack::TempfileReaper#call'
rack (2.2.23) lib/rack/conditional_get.rb:27:in 'Rack::ConditionalGet#call'
rack (2.2.23) lib/rack/head.rb:12:in 'Rack::Head#call'
actionpack (8.0.5) lib/action_dispatch/http/permissions_policy.rb:38:in 'ActionDispatch::PermissionsPolicy::Middleware#call'
lib/content_security_policy/middleware.rb:12:in 'ContentSecurityPolicy::Middleware#call'
lib/middleware/anonymous_cache.rb:417:in 'Middleware::AnonymousCache#call'
lib/middleware/csp_script_nonce_injector.rb:12:in 'Middleware::CspScriptNonceInjector#call'
lib/middleware/track_view_session_id_injector.rb:12:in 'Middleware::TrackViewSessionIdInjector#call'
config/initializers/008-rack-cors.rb:26:in 'Discourse::Cors#call'
rack (2.2.23) lib/rack/session/abstract/id.rb:266:in 'Rack::Session::Abstract::Persisted#context'
rack (2.2.23) lib/rack/session/abstract/id.rb:260:in 'Rack::Session::Abstract::Persisted#call'
actionpack (8.0.5) lib/action_dispatch/middleware/cookies.rb:706:in 'ActionDispatch::Cookies#call'
actionpack (8.0.5) lib/action_dispatch/middleware/callbacks.rb:31:in 'block in ActionDispatch::Callbacks#call'
activesupport (8.0.5) lib/active_support/callbacks.rb:100:in 'ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.5) lib/action_dispatch/middleware/callbacks.rb:30:in 'ActionDi

```

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [May 23, 2026, 3:36pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/2 "2026-05-23T15:36:08Z")

</div>

it’s likely that nesting and post voting are not compatible (yet)

> [@Introducing nested replies](https://meta.discourse.org/t/introducing-nested-replies/402812/27):
>
> One of the options we explored for nesting like this was enhancing the Post Voting plugin, but we decided not to go that route. This is much easier to maintain, the experience is better. I think absolutely it could replace Post Voting one day – or already does in some cases.

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [May 26, 2026, 1:11pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/3 "2026-05-26T13:11:29Z")

</div>

Yes – I think best solution for now is add some checks in the post voting plugin to skip logic when nesting is enabled for a topic. Basically explicitly make the plugin incompatible with nested replies.

It would be cool also to have a “convert to nested replies” mode for post voting. I assume there will be a % of post voting users who would simply like to swap to nested replies.

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [May 26, 2026, 2:03pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/4 "2026-05-26T14:03:43Z")

</div>

@Falco disabling post voting for nested topics [DEV: Disable post voting plugin on nested replies topics · Pull Request #40305 · discourse/discourse](https://github.com/discourse/discourse/pull/40305)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 26, 2026, 3:59pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/5 "2026-05-26T15:59:46Z")

</div>

Have you seen this?

> <https://github.com/discourse/discourse/pull/40187>
>
> When posting a post-voting topic using \`discourse-post-voting\` plugin, and openi…ng it in nested view, the page render failed.
> 
> In devcontainer, the page throw an unrecoverable render error.
> 
> And in production, the server returned 500 error.
> 
> This issue stems from the \`shouldRender\` reading \`topicPageQueryParams\` unguarded, in nested view, the connector failed. This commit solved this by adding a guard to that.
> 
> Also add some specs to avoid regression.
> 
> Before:
> 
> \<img width="1917" height="912" alt="image" src="https://github.com/user-attachments/assets/1ebb901f-a3c6-43a5-8a72-76cb7bae13be" /\>
> 
> After:
> 
> \<img width="1917" height="926" alt="image" src="https://github.com/user-attachments/assets/a35ef924-5481-475b-8ca1-88557fe437b6" /\>
> 
> Also solved an issue preventing the textarea triggered by clicking \`Add a comment\` button from focusing in nested view.

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [May 26, 2026, 4:06pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/6 "2026-05-26T16:06:14Z")

</div>

I had not, no! I still prefer the idea of disabling post voting for nested replies, as it is so similar, and will ensure there aren’t further issues with compatibility 🤔

---

<div class="post-metadata">

### Author: ![small-lovely-cat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/small-lovely-cat/32/553546_2.png) [@small-lovely-cat](https://meta.discourse.org/u/small-lovely-cat)
#### Post date: [May 26, 2026, 9:29pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/7 "2026-05-26T21:29:33Z")

</div>

They seems to be a similar function…

But post-voting has the function of agreeing/disagreeing with a post. Users may feel strange if they are using nested view by default, and open a post-voting topic, only to find they can’t vote that while others in flat view can.

Maybe, adding support a better idea? Not such sure about this.

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [May 27, 2026, 1:22pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/8 "2026-05-27T13:22:21Z")

</div>

For now I’m going to disable it for nested replies. In the future we could consider building an upvote/downvote feature directly into nested replies so it would be a better more direct replacement for post voting.

---

<div class="post-metadata">

### Author: ![cuo\_wu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cuo_wu/32/498442_2.png) [@cuo\_wu](https://meta.discourse.org/u/cuo_wu)
#### Post date: [May 27, 2026, 3:25pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/9 "2026-05-27T15:25:35Z")

</div>

This is a better approach: adding a voting feature to nested replies, which makes the top sorting more meaningful.

---

<div class="post-metadata">

### Author: ![cuo\_wu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cuo_wu/32/498442_2.png) [@cuo\_wu](https://meta.discourse.org/u/cuo_wu)
#### Post date: [May 27, 2026, 3:34pm UTC](https://meta.discourse.org/t/error-occur-when-enable-nest-replies-and-post-voting/403696/10 "2026-05-27T15:34:47Z")

</div>

Yes, actually, regardless of whether it’s a nested reply, there should be a vote feature. I’ve made some changes to post voting and nested views.

 ![Screenshot 2026-05-27 23.33.56](https://global.discourse-cdn.com/meta/original/4X/f/9/f/f9f6020552fed8b97ee4ad074a858c7fbe9681e9.png)  
 ![Screenshot 2026-05-27 23.34.09](https://global.discourse-cdn.com/meta/original/4X/1/0/2/102f6babe8f1ffd5e9d8bc2a120da74528157a26.jpeg)
