10

I noticed an error in my JS console when visiting closed questions on SO:

Uncaught (in promise) TypeError: n is null
    <anonymous> https://cdn.sstatic.net/Js/questions/show.en.js?v=f6ce488fd0ca:1
    <anonymous> https://cdn.sstatic.net/Js/questions/show.en.js?v=f6ce488fd0ca:1
    promise callback* https://cdn.sstatic.net/Js/questions/show.en.js?v=f6ce488fd0ca:1
    <anonymous> https://cdn.sstatic.net/Js/questions/show.en.js?v=f6ce488fd0ca:1
    <anonymous> https://cdn.sstatic.net/Js/questions/show.en.js?v=f6ce488fd0ca:1
show.en.js:1:21974

Seems to be because of this JS:

const n=document.querySelector("#post-form .js-post-body-field[data-post-type-id='2']"),
s=n.parentElement.querySelector("#js-stacks-editor-container");

Where #post-form does not exist in closed questions. Noticed it because it was preventing some userscript from running.

I checked on another network site and didn't notice the same thing, which is why it's posted here and not MSE.

8
  • I can't reproduce this. I tried this question which has an answer and this one without an answer. I also tried both with the new editor enabled and disabled. I also tried opting out and into the experiments.
    – VLAZ
    Commented Mar 25 at 15:53
  • @VLAZ is there an element with ID post-form in your HTML? For me, on open questions it's right after the answer elements, but is not there on closed questions. I have both the disable new editor and experiment opt-out toggles off. No ad blockers here either, and of course I disabled my userscript extension.
    – miken32
    Commented Mar 25 at 15:56
  • No, nothing with that ID. Might be some A/B test.
    – VLAZ
    Commented Mar 25 at 15:59
  • 1
    Getting the same error as OP on both questions VLAZ linked. All combinations of new-editor and experiments optin.
    – cafce25
    Commented Mar 25 at 16:02
  • I'm on rev 2025.3.25.24352 if that matters. If not an A/B test, it might be a partial roll-out.
    – VLAZ
    Commented Mar 25 at 16:10
  • 1
    It's not the revision, I'm getting 2025.3.25.24352 as well.
    – cafce25
    Commented Mar 25 at 16:14
  • I see the same thing in my console. #post-form is the whole "Your answer" form, so it makes sense why it wouldn't be on closed posts.
    – aynber
    Commented Mar 25 at 17:22
  • 5
    I can repro this - fix incoming!
    – Alex Warren StaffMod
    Commented Mar 25 at 17:28

1 Answer 1

5

Thanks for reporting this - it is fixed now.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.