Not a bug Error rendering template public:core.less: ParseError: missing closing `}` in public:core.less on line 34444, column 2 (on or near line 34444)

SFFNetwork

Member
Affected version
2.1.8 Patch 2
Our website is more or less broken upon completing the update to 2.1.8 Patch 2. I've been digging through template files but can't find the specific template where this issue is.

Code:
XF\CssRenderException: Error rendering template public:core.less: ParseError: missing closing `}` in public:core.less on line 34444, column 2 (on or near line 34444) src/XF/CssRenderException.php:87

Stack trace
Code:
34441 |     user-select: none;
 34442 |
 34443 |     > span:before
*34444*|     {
 34445 |         .m-faBase();
 34446 |         .m-faContent(@fa-var-cog);
 34447 |
------------

#0 src/XF/CssRenderer.php(408): XF\CssRenderException::createFromLessException(Object(Less_Exception_Chunk), 'public:core.les...', '// Note that th...')
#1 src/XF/CssRenderer.php(342): XF\CssRenderer->renderToCss('public:core.les...', '// Note that th...')
#2 src/XF/CssRenderer.php(250): XF\CssRenderer->renderTemplate('public:core.les...', NULL)
#3 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#4 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#5 css.php(30): XF\CssWriter->run(Array, 17, 1, 'dda47655fd01980...')
#6 {main}

-------------

Previous Less_Exception_Chunk: ParseError: missing closing `}` in anonymous-file-0.less on line 34444, column 2
34442|
34443|     > span:before
34444|     {
34445|         .m-faBase();
34446|         .m-faContent(@fa-var-cog);
34447|          - src/vendor/oyejorge/less.php/lib/Less/Parser.php:677
#0 src/vendor/oyejorge/less.php/lib/Less/Parser.php(621): Less_Parser->GetRules(NULL)
#1 src/vendor/oyejorge/less.php/lib/Less/Parser.php(449): Less_Parser->_parse()
#2 src/XF/CssRenderer.php(404): Less_Parser->parse('// Note that th...')
#3 src/XF/CssRenderer.php(342): XF\CssRenderer->renderToCss('public:core.les...', '// Note that th...')
#4 src/XF/CssRenderer.php(250): XF\CssRenderer->renderTemplate('public:core.les...', NULL)
#5 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#6 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#7 css.php(30): XF\CssWriter->run(Array, 17, 1, 'dda47655fd01980...')
#8 {main}

Request state
Code:
array(4) {
  ["url"] => string(200) "/forum/css.php?css=public%3Anormalize.css%2Cpublic%3Acore.less%2Cpublic%3Aapp.less%2Cpublic%3Auix_material.less%2Cpublic%3Auix_pro.less&s=17&l=1&d=1584841968&k=dda47655fd0198049367b9dd3a037d3c71fd159c"
  ["referrer"] => bool(false)
  ["_GET"] => array(5) {
    ["css"] => string(98) "public:normalize.css,public:core.less,public:app.less,public:uix_material.less,public:uix_pro.less"
    ["s"] => string(2) "17"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1584841968"
    ["k"] => string(40) "dda47655fd0198049367b9dd3a037d3c71fd159c"
  }
  ["_POST"] => array(0) {
  }
}
 
I do not, that works fine.

My interpretation is that a part of the update or the template merges added or modified css/less and left an open bracket, which is now killing any attempts to render the site using our standard template. But I can't tell based on the error where the issue is - what template file specifically. It is NOT in core.less, but core.less imports a ton of other templates.
 
I already have, but I suppose I'm just frustrated because it seems like it should be possible to determine what template file the issue is in. Am I missing something obvious or is the error really not able to specify which template file the syntax issue is on?
 
Maybe one of these, public:normalize.css,public:core.less,public:app.less,public:uix_material.less,public:uix_pro.less but themehouse can help you as they know their structure.
 
I already have, but I suppose I'm just frustrated because it seems like it should be possible to determine what template file the issue is in. Am I missing something obvious or is the error really not able to specify which template file the syntax issue is on?
Personally... If it is making your site unusable to your members I would make the xF style your default for now until TH fixes your problem.
 
Maybe one of these, public:normalize.css,public:core.less,public:app.less,public:uix_material.less,public:uix_pro.less but themehouse can help you as they know their structure.

I had already skimmed all of them but none have either the snippet in the stack trace, nor did they seem to have any syntax issues in general. However, many of them include() other templates (usually quite a few).

Personally... If it is making your site unusable to your members I would make the xF style your default for now until TH fixes your problem.

I will spend some more time on this first, but that's likely what we will do since waiting until Monday for ThemeHouse is not tenable honestly.
 
It's because of issues like this most admins learn that they should have done one of two things (should do both).

1) Test any changes on a test site before messing with a live site.
2) Take a full backup before making updates to addons or the XF2 core. That way if something goes wrong, you can go back to a working situation.
 
I had this same kind of issue once before and you'll pull your hair out before you find it. Gotta keep the membership in mind.

Agreed.

It's because of issues like this most admins learn that they should have done one of two things (should do both).

1) Test any changes on a test site before messing with a live site.
2) Take a full backup before making updates to addons or the XF2 core. That way if something goes wrong, you can go back to a working situation.

We're actually in the process of standing up both, but obviously future plans don't help much now haha.

It's bizarre to me that this of all updates is what broke something. And this is after multiple patches by XF, one of which fixed an issue with a template change it made ¯\(ツ)
 
Agreed.



We're actually in the process of standing up both, but obviously future plans don't help much now haha.

It's bizarre to me that this of all updates is what broke something. And this is after multiple patches by XF, one of which fixed an issue with a template change it made ¯\(ツ)
The latest version hasn't been xF's finest hour.
 
So through brute force I've identified that the snippet mentioned in the stack trace is in the core_xfrm.less template, which is related to XenForo's Resource Manager. Oddly, the contents of it are as follows...

Code:
.avatar.avatar--resourceIconDefault
{
    color: xf-default(@xf-textColorMuted, black) !important;
    background: mix(xf-default(@xf-textColorMuted, black), xf-default(@xf-avatarBg, white), 25%) !important;
    text-align: center;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    > span:before
    {
        .m-faBase();
        .m-faContent(@fa-var-cog);
        <xf:macro name="content" template="uix_icons.less" arg-icon="settings" />
    }
}

Which syntactically looks fine to me. Further, if I comment out the entire block, or just the > span:before, or just the <xf:macro name="content" template="uix_icons.less" arg-icon="settings" />, the issue is not fixed and the same error more or less continues to be generated by XF.
 
Back
Top Bottom