1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Service Issue NoScript causing error on Facebook Open Graph Object Debugger

Discussion in 'Resolved Bug Reports' started by owls8521, Jan 20, 2015.

  1. owls8521

    owls8521 Active Member

    When I put one of my urls into the Facebook Open Graph Object Debugger, I received the following error:
    I found that the following line in PAGE_CONTAINER was causing the issue:
    <noscript><style>.JsOnly, .jsOnly { display: none !important; }</style></noscript>
    I solved it by moving that line to right before the closing head tag. If you do not do that, Facebook will close the head tag early.
    Last edited: Jan 20, 2015
  2. Chris D

    Chris D XenForo Developer Staff Member

    At the moment, this isn't reproducible.

    For it to be considered a bug, it would need to be something that could be reproduced reliably on the default XF style. In fact, I've just tried it on a number of sites (including this one) and other sites that use custom styles, and none of them report the same issue.

    This would lead me to believe, in fact, that there could be some other problem in your template.

    All that being said, the HTML is valid, and <noscript> is not considered to be a meta tag, so the error from Facebook makes very little sense.

    If you would be able to put the code back where it was, I'll happily do a bit more testing to see if we can make a bit more sense as to what's going on.
  3. owls8521

    owls8521 Active Member

    I just tested it on this page. To reproduce:
    1. Go to Facebook Open Graph Object Debugger
    2. Enter https://xenforo.com/community/threads/noscript-causing-error-on-facebook-open-graph-object-debugger.91232/ into the box.
    3. Click the Fetch new scrape information button
    4. See the error that appears
    The following screenshot shows I'm using this url.

    Screen Shot 2015-01-20 at 4.04.29 PM.png

    For even more information, click the link at the bottom of the page that says See exactly what our scraper sees for your URL.

    Here's the beginning of the output:
    Notice the closing head tag appears right before the noscript tag.
  4. Mike

    Mike XenForo Developer Staff Member

    This looks like a bug in the FB tool to me. It has randomly rewritten some of the HTML in ways that we certainly aren't outputting (changed tabs/line breaks, HTML tags changing structure). It's actually even added a line that isn't in the HTML (the opening <meta> tag).
  5. ph.d

    ph.d Member

    Now we have to wait Facebook fix this bug? Or any temporary solution for this bug?
  6. Chris D

    Chris D XenForo Developer Staff Member

    I would recommend reporting it to Facebook if it is affecting you. They won't fix it unless there are reports of it happening.

    You could modify your templates as described in the first post, but really this should not be necessary and counter productive if you do end up reporting it to Facebook (they'll likely want to see a reproduction of the bug). Our HTML is valid. I think Facebook is doing something weird to force the HTML to be valid based on old standards. I believe <noscript> tags were previously invalid in <head> in earlier HTML specs. In HTML5, though, it is perfectly valid and passes various validation tests.
    owls8521 and ph.d like this.
  7. batpool52!

    batpool52! Well-Known Member

    I've reported.
  8. owls8521

    owls8521 Active Member

  9. Hardcore

    Hardcore Active Member

    It's happening with all of our pages too; as of 1.4.4 I believe.

    It's definitely Facebook bug that takes issue with the <noscript> tag placement. If you move it just before </head> the Facebook Open Graph Object Debugger will move it to the first line after the <body> tag and the errors will cease.

    It's not ideal, but moving the <noscript> line out of the <head></head> will act as a temporary workaround.
    Last edited: Jan 21, 2015
  10. ph.d

    ph.d Member

    I try to mote <noscript> before </head> but the errors is cseased. But this change can affect my forum? Example affect search engine? I'm not a coder.

    Attached Files:

  11. ph.d

    ph.d Member

    @Mike could you answer my question above, please thanks :)
  12. Chris D

    Chris D XenForo Developer Staff Member

    It won't have an effect either way.
    ph.d likes this.
  13. Richey

    Richey Member

    Same problem over here.

    Facebook also does not recognize the correct og:image size.
    I use a 512x512 PNG image but the FB URL Linter says that it is too small (under 200px).

    I hope they fix it very soon :confused:
  14. Chris D

    Chris D XenForo Developer Staff Member

    How do FB bug reports work? Is there a public link you can share? Might give it more attention if other people report the same thing.
  15. Mike

    Mike XenForo Developer Staff Member

    Liam W and Chris D like this.
  16. batpool52!

    batpool52! Well-Known Member

    @Chris D
    That "Report a Problem" is the link where you should all issues.
  17. ph.d

    ph.d Member

    Maybe Facebook fixed this issue! I moved <noscript> to the previous position :)
    Last edited: Feb 6, 2015
  18. Chris D

    Chris D XenForo Developer Staff Member

Share This Page