Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass is not working with node 15+ #3256

Closed
steveetm opened this issue Feb 4, 2022 · 12 comments
Closed

Sass is not working with node 15+ #3256

steveetm opened this issue Feb 4, 2022 · 12 comments
Assignees
Labels
bug Something isn't working needs info Blocked on user response

Comments

@steveetm
Copy link

steveetm commented Feb 4, 2022

I have no fibers installed, and using fibers: false, have no refernce to fibers anywhere, not even installed!

I have strange issues with sass when I upgrade node from 14. Our project setup is pretty complex and I couldn't create a standalone repro yet, but pretty sure the issue is with sass itself.

If I upgrade to e.g. to node 16 and replace sass-loader with null-loader, everything fine. But with sass-loader it always hangs at some scss file. It is almost impossible to figure out where, as when I inspect this hanging node process and press 'pause', the inspector itself freeze, eventually segfaulting node process. The only usable information I managed to get, is a stacktrace on sigint, which is the following:

    at ./node_modules/sass/sass.dart.js:4372:11
    at call$2 (./node_modules/sass/sass.dart.js:25904:12)
    at call$1 (./node_modules/sass/sass.dart.js:25890:32)
    at _rootRunUnary (./node_modules/sass/sass.dart.js:4749:18)
    at ./node_modules/sass/sass.dart.js:91240:16
    at runUnary$2$2 (./node_modules/sass/sass.dart.js:27305:39)
    at call$0 (./node_modules/sass/sass.dart.js:26379:51)
    at _Future__propagateToListeners (./node_modules/sass/sass.dart.js:4548:93)
    at _completeWithValue$1 (./node_modules/sass/sass.dart.js:26221:9)
    at complete$1 (./node_modules/sass/sass.dart.js:25877:14)

Tried with recent version and almost every version back to 1.35.2 (the above trace created with that version).
The very same version works perfectly with node 14, without fibers! Tried node 15, 16, 17, x86 and arm versions, same result.

Appreciate any advices.

Update
Looks like I found the breaking version.
1.32.13 working fine even with node 16, but 1.33.0 fails. Really strange:/

@nex3
Copy link
Contributor

nex3 commented Feb 4, 2022

Can you provide a minimal reproduction?

@nex3 nex3 added bug Something isn't working needs info Blocked on user response labels Feb 4, 2022
@steveetm
Copy link
Author

steveetm commented Feb 5, 2022

Actually I managed to find the file which cause the issue, if I build the whole project. But actually that file does nothing interesting, uses a globally included mixin and extends an ionicon class.
If move imports into that file, and build only that, everything is fine again. Once I include that file in the project, it stops right there(Put some debug info into sass compiler to see which import is being processed, that file is the breaking point).
There is also a lot of stuff to compile after that.

My original thought that there is some kind of filesystem case inconsistency, and due how our monorepo structured and modules included, sass import run into some crazy async import thing, but this is clearly not the case.

Do you have any advice how to continue debug this? I can stop the chrome debugger anytime before that import, when that file is being compiled, inspector is unusable:/ (atm trying to narrow down rules in that file)

@steveetm
Copy link
Author

steveetm commented Feb 5, 2022

Worth to note long ago I reported a regression with @extends, which was turned out as a bug:
sass/dart-sass#1109

In our legacy scss code we have some really crazy extends, but this used to be work, and nothing new added as we are moving into separate scss modules wherever possible. Maybe it rings some bells.

@steveetm
Copy link
Author

steveetm commented Feb 5, 2022

Okey, found a standalone repro(the inliner is not correct, I know, removed logic which is not needed for the repro):

@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);

  @if $index {
    @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
  }

  @return $string;
}

@function replaceWrap($str) {
  $str: str-replace($str, '"', $replace: '%22');
}

@function logo($color) {

  @return replaceWrap('<svg  xmlns:dc="http://purl.org/dc/elements/1.1/"  xmlns:cc="http://creativecommons.org/ns#"  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:svg="http://www.w3.org/2000/svg"  xmlns="http://www.w3.org/2000/svg"  xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"  xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"  width="786.81995"  height="786.81995"  viewBox="0 0 208.17944 208.17944"  version="1.1"  id="svg4443"  inkscape:version="0.92.0 r15299"  sodipodi:docname="xero.svg"><defs id="defs4437"> <inkscape:perspective  id="perspective87"  inkscape:persp3d-origin="372.04723 : 350.78736 : 1"  inkscape:vp_z="744.09449 : 526.18106 : 1"  inkscape:vp_y="0 : 999.99994 : 0"  inkscape:vp_x="0 : 526.18106 : 1"  sodipodi:type="inkscape:persp3d" /> <font  font-weight="700"  font-style="normal"  font-variant="normal"  id="FontID0"  horiz-origin-x="0"  horiz-origin-y="0"  horiz-adv-x="90"  vert-origin-x="45"  vert-origin-y="90"  vert-adv-y="90"  style="font-style:normal;font-variant:normal;font-weight:700"> <font-face id="font-face7" font-family="Arial Narrow"> </font-face> <missing-glyph id="missing-glyph9"> <path id="path11" d="M0 0z" /> </missing-glyph> <glyph id="glyph13" horiz-adv-x="228" unicode=" " /> <glyph id="glyph15" horiz-adv-x="500" unicode="L"> <path id="path17" d="M62.9955 0l0 710 118.173 0 0 -589.33 294.829 0 0 -120.669 -413.002 0z" /> </glyph> <glyph id="glyph19" horiz-adv-x="774" unicode="W"> <path id="path21" d="M142.504 0l-140.007 715.836 121.501 0 87.8301 -491.667 107.507 491.667 141.168 0 102.996 -500 90.3377 500 119.158 0 -142.657 -715.836 -126.002 0 -117.165 535.171 -116.169 -535.171 -128.499 0z" /> </glyph> <glyph id="glyph23" horiz-adv-x="456" unicode="k"> <path id="path25" d="M55.1662 0l0 715.836 112.829 0 0 -379.834 131.335 182.493 138.671 0 -145.504 -189.326 155.666 -329.169 -120.998 0 -107.496 232.83 -51.6732 -66.828 0 -166.002 -112.829 0z" /> </glyph> <glyph id="glyph27" horiz-adv-x="456" unicode="e"> <path id="path29" d="M305.67 164.995l111.833 -22.8308c-15.0015,-52.1659 -38.336,-90.8304 -69.8393,-115.994 -31.6675,-25.3384 -69.9926,-37.8323 -115.161,-37.8323 -62.8312,0 -111.34,20.9912 -145.668,62.9955 -40.3289,48.8371 -60.4989,117.165 -60.4989,204.995 0,86.6694 20.3342,156.005 61.0026,208.007 34.4926,43.9972 79.1577,65.9958 133.831,65.9958 60.8274,0 108.668,-22.5023 143.161,-67.4959 39.6719,-51.3337 59.5024,-127.174 59.5024,-227.498l-0.503701 -15.6695 -281.657 0c0.657001,-40.9969 9.83312,-72.6644 27.4955,-95.1667 17.8376,-22.5023 39.1682,-33.6713 64.1671,-33.6713 36.1679,0 60.3346,24.6704 72.3359,74.1645zm6.32911 138.671c-0.996452,40.3289 -9.66887,70.8357 -25.8311,91.1699 -16.3374,20.3342 -35.6642,30.4958 -58.1665,30.4958 -23.663,0 -43.8329,-10.6653 -60.0061,-31.8317 -16.6659,-21.4949 -24.8237,-51.3337 -24.4952,-89.834l168.499 0z" /> </glyph> <glyph id="glyph31" horiz-adv-x="500" unicode="o"> <path id="path33" d="M32.6639 266.666c0,50.6658 10.1726,96.9953 30.3316,138.671 20.1699,41.6648 46.5048,72.8286 79.1687,93.6665 32.4997,20.8269 69.1713,31.328 109.84,31.328 68.3282,0 121.994,-26.8276 161.162,-80.3294 39.004,-53.6661 58.495,-116.169 58.495,-187.837 0,-53.3376 -10.1616,-101.496 -30.4958,-144.497 -20.3342,-43.0007 -46.9975,-75.3362 -80.0009,-96.8311 -33.1676,-21.6701 -69.3356,-32.4997 -108.668,-32.4997 -63.1597,0 -115.665,23.9915 -157.33,72.1607 -41.6648,48.1692 -62.5027,116.837 -62.5027,206.167zm115.337 -7.33652c0,-52.4944 10.1616,-92.1664 30.671,-118.994 20.4984,-26.8385 45.3331,-40.1647 74.3288,-40.1647 28.3277,0 52.4944,13.4904 72.6644,40.4932 20.1699,27.0028 30.3316,66.8389 30.3316,119.673 0,51.3337 -10.3259,90.5019 -30.8243,117.658 -20.5094,27.0028 -45.0046,40.5041 -73.6718,40.5041 -28.3387,0 -52.6696,-13.5014 -73.0038,-40.5041 -20.3342,-27.1561 -30.4958,-66.6637 -30.4958,-118.665z" /> </glyph> <glyph id="glyph35" horiz-adv-x="456" unicode="c"> <path id="path37" d="M429.668 365.161l-110.836 -24.331c-8.16872,54.334 -33.6604,81.501 -76.6611,81.501 -27.6707,0 -50.0088,-11.6618 -66.8389,-35.1605 -16.9944,-23.3345 -25.5026,-63.0064 -25.5026,-118.676 0,-61.4953 8.50817,-105 25.5026,-130.327 16.8302,-25.3384 39.4967,-37.9966 67.8354,-37.9966 21.1664,0 38.5003,7.16132 52.1659,21.6591 13.8299,14.5088 23.4988,40.1647 29.3351,76.8363l110.836 -22.8308c-22.6665,-125.005 -88.3338,-187.497 -196.673,-187.497 -69.3356,0 -120.834,26.3239 -154.33,78.9935 -33.4961,52.8339 -50.3373,116.333 -50.3373,190.498 0,88.8375 18.9983,156.509 56.8306,202.838 38.0075,46.3296 87.6768,69.6641 149.172,69.6641 49.8336,0 90.5019,-13.1619 121.83,-39.661 31.5032,-26.3348 54.0055,-68.1748 67.6711,-125.509z" /> </glyph> <glyph id="glyph39" horiz-adv-x="228" unicode="i"> <path id="path41" d="M59.163 588.838l0 126.998 112.676 0 0 -126.998 -112.676 0zm0 -588.838l0 518.495 112.676 0 0 -518.495 -112.676 0z" /> </glyph> <glyph id="glyph43" horiz-adv-x="500" unicode="n"> <path id="path45" d="M445.83 0l-112.829 0 0 264.662c0,53.0091 -2.1681,88.3338 -6.32911,106.007 -4.17196,17.4981 -12.1764,30.9995 -23.674,40.4932 -11.4975,9.34037 -24.6595,14.1693 -39.3325,14.1693 -18.834,0 -36.0037,-6.16486 -51.3337,-18.3303 -15.1658,-12.1655 -25.9954,-29.0066 -32.1602,-50.5015 -6.17581,-21.4949 -9.34037,-61.999 -9.34037,-121.666l0 -234.834 -112.665 0 0 518.495 104.496 0 0 -76.1574c18.5055,29.3242 39.3325,51.3337 62.667,65.9958 23.3345,14.6621 49.0014,21.9986 77.34,21.9986 32.9924,0 60.6631,-8.66147 83.3297,-25.6669 22.6665,-17.1696 38.1718,-39.1682 46.8333,-65.9958 8.67242,-26.8385 12.9977,-65.6673 12.9977,-116.333l0 -322.336z" /> </glyph> <glyph id="glyph47" horiz-adv-x="456" unicode="a"> <path id="path49" d="M142.996 360.332l-101.999 22.5023c12.3407,52.3302 32.8391,89.9982 61.3311,112.993 28.5029,23.006 69.3356,34.5035 122.837,34.5035 47.5012,0 83.8334,-6.66856 108.832,-19.9947 24.9989,-13.5014 43.0007,-31.5032 53.6661,-54.4983 10.8405,-23.006 16.1732,-64.6708 16.1732,-125.334l-1.0074 -160.166c0,-44.8403 1.8396,-78.3365 5.33266,-100.335 3.66826,-21.8343 10.3368,-45.3331 20.0057,-70.0035l-111.34 0 -14.6621 56.6664c-19.1625,-22.8308 -39.661,-39.8362 -61.6705,-51.3337 -21.9986,-11.3333 -45.3331,-16.9944 -70.1568,-16.9944 -41.3363,0 -75.1719,13.8299 -101.507,41.6648 -26.3348,27.835 -39.4967,64.8351 -39.4967,111.165 0,29.1709 5.33266,54.8377 15.998,76.6611 10.8296,21.8343 25.9954,39.1682 45.4974,52.1659 19.502,13.0086 50.841,24.6704 93.6665,34.6678 52.1659,12.0012 88.4981,23.3345 109.007,33.6713 0,28.6672 -2.00385,47.5012 -6.17581,56.5021 -3.99676,8.82572 -11.4975,16.1622 -22.4913,21.8343 -10.8405,5.82541 -26.1706,8.66147 -46.0011,8.66147 -20.3342,0 -36.1679,-4.66471 -47.6655,-13.6656 -11.5085,-9.16517 -21.0021,-26.1706 -28.1744,-51.3337zm150.508 -111.329c-14.3336,-5.83636 -36.6716,-12.6692 -67.0032,-20.4984 -34.832,-9.17612 -57.4986,-19.1735 -68.3391,-30.3425 -10.6653,-10.9938 -15.998,-25.3274 -15.998,-42.8255 0,-19.8414 5.83636,-36.6716 17.6733,-50.173 12.0012,-13.5014 26.8276,-20.159 44.8294,-20.159 15.8337,0 31.6675,5.33266 47.337,16.3265 15.4943,10.8405 26.3348,23.8382 32.4997,38.8397 6.00061,14.9906 9.00092,42.1576 9.00092,81.4901l0 27.3422z" /> </glyph> <glyph id="glyph51" horiz-adv-x="500" unicode="d"> <path id="path53" d="M449.17 0l-105 0 0 76.1684c-17.1696,-29.3351 -37.5038,-51.3337 -61.0026,-65.8315 -23.3345,-14.673 -47.5012,-21.9986 -72.1716,-21.9986 -47.6655,0 -88.9908,23.663 -124.327,71 -35.3357,47.326 -52.9981,114.997 -52.9981,202.827 0,88.6733 17.3339,155.337 51.8265,200.506 34.5035,44.9936 77.0006,67.6602 127.338,67.6602 23.8273,0 46.0011,-6.00061 66.6637,-18.1661 20.6627,-12.0012 39.6719,-30.0031 57.0058,-54.1698l0 257.84 112.665 0 0 -715.836zm-300.173 270.498c0,-46.8333 3.83251,-81.8295 11.837,-104.66 8.00447,-23.006 19.502,-40.3399 34.1641,-51.8374 14.8373,-11.4975 31.5032,-17.3339 50.173,-17.3339 24.6595,0 46.1653,13.3371 64.3314,40.0004 18.3303,26.6633 27.3313,67.0032 27.3313,120.669 0,59.4915 -8.83667,102.492 -26.4991,128.663 -17.8376,26.1706 -40.3399,39.3325 -67.6711,39.3325 -25.9954,0 -48.1582,-12.8334 -66.3352,-38.6645 -18.3303,-25.6669 -27.3313,-64.3314 -27.3313,-116.169z" /> </glyph> <glyph id="glyph55" horiz-adv-x="318" unicode="r"> <path id="path57" d="M166.999 0l-112.829 0 0 518.495 104.496 0 0 -73.6608c18.0018,34.5035 33.9998,57.3343 48.1692,68.6676 14.1693,11.169 30.4958,16.8302 49.0014,16.8302 25.6669,0 50.3263,-8.66147 73.8251,-25.9954l-35.1605 -119.498c-18.6698,14.8263 -36.1679,22.3271 -52.8339,22.3271 -15.6695,0 -29.3351,-5.66116 -41.1721,-17.3339 -11.9903,-11.4975 -20.4984,-32.3354 -25.6669,-62.667 -5.15746,-30.3316 -7.82927,-86.0015 -7.82927,-166.999l0 -160.166z" /> </glyph> <glyph id="glyph59" horiz-adv-x="272" unicode="t"> <path id="path61" d="M253.504 518.495l0 -109.325 -76.6721 0 0 -209.003c0,-45.1688 0.996452,-71.5037 3.33976,-78.5007 4.48951,-13.1619 13.8299,-19.6662 27.824,-19.6662 10.5011,0 25.3384,4.50046 45.0046,13.1619l9.66887 -106.325c-26.0063,-13.6656 -55.5057,-20.4984 -88.3338,-20.4984 -28.6672,0 -51.6732,6.83282 -68.8319,20.4984 -17.3339,13.6656 -28.8314,33.3319 -34.6678,58.9987 -4.66471,18.9983 -6.83282,57.3343 -6.83282,115.337l0 225.998 -51.8374 0 0 109.325 51.8374 0 0 103.171 112.829 80.0009 0 -183.172 76.6721 0z" /> </glyph> <glyph id="glyph63" horiz-adv-x="638" unicode="w"> <path id="path65" d="M138.671 0l-134.839 518.495 109.5 0 79.4972 -339.823 73.3323 339.823 108.34 0 70.8357 -339.823 81.501 339.823 110.825 0 -136.667 -518.495 -108 0 -73.1681 333.505 -72.3249 -333.505 -108.832 0z" /> </glyph> <glyph id="glyph67" horiz-adv-x="456" unicode="y"> <path id="path69" d="M5.33266 518.495l120.166 0 101.003 -368.162 99.6671 368.162 116.169 0 -149.84 -498.993 -28.8314 -97.1705c-12.6692,-36.4964 -25.3274,-63.1597 -37.8323,-80.0009 -12.5049,-16.9944 -28.5029,-29.9921 -47.8297,-39.1682 -19.3377,-9.00092 -43.165,-13.6656 -71.5037,-13.6656 -21.8343,0 -43.165,2.83606 -64.0029,8.33297l-9.83312 107.507c17.6733,-4.33621 33.3319,-6.34006 47.337,-6.34006 21.4949,0 39.1682,7.17227 52.9981,21.3416 13.8299,14.3226 25.1632,40.4932 33.9998,78.1613l-161.666 519.995z" /> </glyph> </font> <style  id="style71"  type="text/css">  @font-face { font-family:&quot;Arial Narrow&quot;;src:url(&quot;#FontID0&quot;) format(svg)} .fil0 {fill:#28166F} .fnt0 {font-weight:bold;font-size:9.1324;}  </style> <clipPath  clipPathUnits="userSpaceOnUse"  id="clipPath18">  <path  d="M 0,850.394 H 850.394 V 0 H 0 Z"  id="path16"  inkscape:connector-curvature="0" /> </clipPath> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.68000308" inkscape:cx="391.90999" inkscape:cy="391.90999" inkscape:document-units="mm" inkscape:current-layer="layer1" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" units="px" inkscape:window-width="1280" inkscape:window-height="744" inkscape:window-x="-4" inkscape:window-y="-4" inkscape:window-maximized="1" /> <metadata id="metadata4440"> <rdf:RDF>  <cc:Work  rdf:about="">  <dc:format>image/svg+xml</dc:format>  <dc:type  rdf:resource="http://purl.org/dc/dcmitype/StillImage" />  <dc:title></dc:title>  </cc:Work> </rdf:RDF> </metadata> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-5.8874759,-271.69643)"> <g  id="g10"  transform="matrix(0.35277777,0,0,-0.35277777,-39.929542,525.63751)">  <g  id="g12">  <g  id="g14"  clip-path="url(#clipPath18)">  <path   d="m 424.933,130.843 c 162.335,0 293.932,131.597 293.932,293.933 0,162.334 -131.597,293.932 -293.932,293.932 C 262.598,718.708 131,587.11 131,424.776 131,262.44 262.598,130.843 424.933,130.843"   fill="#{$color}" style="fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path20"   inkscape:connector-curvature="0" />  <path   d="m 271.701,425.625 50.162,50.286 c 1.663,1.695 2.591,3.939 2.591,6.319 0,4.96 -4.032,8.988 -8.992,8.988 -2.416,0 -4.681,-0.947 -6.389,-2.676 -0.005,-0.01 -50.117,-50.093 -50.117,-50.093 l -50.341,50.168 c -1.701,1.677 -3.955,2.601 -6.345,2.601 -4.954,0 -8.987,-4.026 -8.987,-8.981 0,-2.417 0.965,-4.685 2.697,-6.394 l 50.155,-50.148 -50.129,-50.223 c -1.762,-1.735 -2.723,-4.008 -2.723,-6.436 0,-4.959 4.033,-8.982 8.987,-8.982 2.394,0 4.65,0.929 6.345,2.625 l 50.263,50.195 50.072,-50.012 c 1.776,-1.836 4.067,-2.814 6.512,-2.814 4.955,0 8.987,4.029 8.987,8.988 0,2.393 -0.927,4.641 -2.614,6.336 z"   style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path22"   inkscape:connector-curvature="0" />  <path   d="m 569.906,425.64 c 0,-9.006 7.323,-16.332 16.34,-16.332 8.996,0 16.322,7.326 16.322,16.332 0,9.008 -7.326,16.333 -16.322,16.333 -9.017,0 -16.34,-7.325 -16.34,-16.333"   style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path24"   inkscape:connector-curvature="0" />  <path   d="m 538.93,425.632 c 0,26.08 21.216,47.3 47.299,47.3 26.07,0 47.291,-21.22 47.291,-47.3 0,-26.074 -21.221,-47.285 -47.291,-47.285 -26.083,0 -47.299,21.211 -47.299,47.285 m -18.606,0 c 0,-36.334 29.565,-65.895 65.905,-65.895 36.339,0 65.919,29.561 65.919,65.895 0,36.339 -29.58,65.908 -65.919,65.908 -36.34,0 -65.905,-29.569 -65.905,-65.908"   style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path26"   inkscape:connector-curvature="0" />  <path   d="m 515.646,490.413 -2.765,0.008 c -8.301,0 -16.307,-2.618 -22.994,-7.771 -0.881,4.032 -4.485,7.066 -8.778,7.066 -4.941,0 -8.9,-3.959 -8.912,-8.91 0,-0.018 0.03,-111 0.03,-111 0.013,-4.942 4.044,-8.959 8.988,-8.959 4.943,0 8.973,4.017 8.986,8.97 0,0.022 0.004,68.251 0.004,68.251 0,22.748 2.08,31.935 21.566,34.37 1.801,0.224 3.76,0.189 3.768,0.189 5.332,0.183 9.121,3.847 9.121,8.799 0,4.955 -4.045,8.987 -9.014,8.987"   style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path28"   inkscape:connector-curvature="0" />  <path   d="m 343.072,436.482 c 0,0.246 0.019,0.502 0.031,0.755 5.218,20.627 23.899,35.891 46.147,35.891 22.517,0 41.369,-15.639 46.32,-36.646 z m 110.903,1.697 c -3.873,18.337 -13.912,33.399 -29.199,43.072 -22.346,14.187 -51.854,13.402 -73.438,-1.947 -17.606,-12.525 -27.769,-33.014 -27.769,-54.12 0,-5.292 0.638,-10.634 1.966,-15.892 6.648,-26.152 29.13,-45.949 55.934,-49.23 7.954,-0.963 15.696,-0.502 23.713,1.574 6.889,1.676 13.555,4.47 19.697,8.406 6.375,4.098 11.701,9.502 16.859,15.971 0.104,0.119 0.209,0.224 0.313,0.349 3.58,4.44 2.916,10.754 -1.018,13.768 -3.318,2.543 -8.888,3.574 -13.271,-2.039 -0.942,-1.342 -1.993,-2.723 -3.15,-4.104 -3.485,-3.851 -7.809,-7.582 -12.99,-10.476 -6.593,-3.522 -14.106,-5.535 -22.093,-5.58 -26.142,0.291 -40.131,18.539 -45.107,31.564 -0.869,2.432 -1.539,4.955 -2.006,7.553 -0.061,0.486 -0.106,0.955 -0.124,1.387 5.405,0 93.812,0.015 93.812,0.015 12.861,0.27 19.783,9.348 17.871,19.729"   style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"   id="path30"   inkscape:connector-curvature="0" />  </g>  </g> </g> </g> </svg>');
}

.logo {
  background-url: logo(red);
}
const sass = require('sass');

sass.render({
    file: "repro.scss"
}, function(err, result) {
    // Never called :(
    if (err) {
        console.log(err);
    } else {
        console.log(result.css.toString());
    }
});

This throws a stack overflow if I run with sass from command line. It hangs if webpack tries to compile it through sass-loader. But honestly, I don't understand what is going on, as this repro is failing even with Node 14 and 1.32.13:/ And we use this for ages.
Even if this is a stack overflow(I accept this whole is screwed up), it shouldn't just hang. (sass-loader issue? But why it is killing inspector? Or when used through sass-loader this isn't really a stack overflow as render is async, so it simply recursively fill up microtask queue forever?)

@steveetm
Copy link
Author

steveetm commented Feb 5, 2022

And here is the workaround:

@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);

  @if $index {
    $tmp: str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    @return str-slice($string, 1, $index - 1) + $replace + $tmp;
  }

  @return $string;
}

And webpack now can build it with node 14,15,16,17.
@nex3 While this also stress sass a bit, I think there are two bugs actually:

  • sass not reporting error in async mode.
  • this is not really deep recursion which should trigger this.

Not sure why extracting the function call into a tmp variable helps, but it does:/

@jathak jathak self-assigned this Feb 9, 2022
@jurchiks
Copy link

jurchiks commented May 9, 2022

I don't know about you guys, but I am on Node 16.15.0 LTS and SASS 1.51.0, no problems here.
Perhaps the bug has been solved since then, or it's some bit of code that my project doesn't access, can't tell.
Or maybe the issue title needs to be made more specific?

@jathak
Copy link
Member

jathak commented May 10, 2022

It looks like the issue here is that the recursion gets too deep, causing a stack overflow. You should use a for loop instead to avoid this.

@jathak jathak closed this as completed May 10, 2022
@steveetm
Copy link
Author

@jathak Recursion itself can't be the issue, have you checked my workaround?

@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);

  @if $index {
    $tmp: str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    @return str-slice($string, 1, $index - 1) + $replace + $tmp;
  }

  @return $string;
}

is working, but if you inline $tmp it runs into error. The depth of recursion shouldn't depend on the placement of that call at all.

Also, there is another issue, in async mode this error is not reported, as I said earlier. It simply waits forever, this is also a bug.

@jathak
Copy link
Member

jathak commented May 16, 2022

The recursion depth is actually different there, since there's fewer layers of expressions to evaluate (since we're running into Dart/Node's recursion depth limit here, not any limit we've set in the Sass language itself). When running async, it waits (seemingly) forever because it's taking a very long time, but because it's asynchronous, it never actually stack overflows.

@benbcai
Copy link

benbcai commented Sep 2, 2022

Are there any updates on this issue?

I have a project using sass@1.54.8 with Node 14 and everything seems to work fine. When I upgraded to Node 16, my project is now hanging indefinitely during webpack. There are no error messages, it just hangs forever. If I switch from sass back to node-sass and still on Node 16, then everything started working again.

@nex3
Copy link
Contributor

nex3 commented Sep 6, 2022

@benbcai It's likely that you're also hitting a recursion limit somewhere. Can you narrow down which part of your Sass code is the culprit by deleting things until the failure stops happening? It'll be much easier to help you if you can.

@steveetm
Copy link
Author

steveetm commented Jan 25, 2023

@nex3 Sorry, I just can't believe this. If you check my workaround you can clearly see this shouldn't caused by recursion limit, as a simple temp variable extraction solves the problem. But ok, there is a limit. Why can't sass print some warning if hits some kind of 'recursion limit' during async processing?

(just ran into this again, same workaround still working:

@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);

  @if $index {
    $tmp: str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    @return str-slice($string, 1, $index - 1) + $replace + $tmp;
  }

  @return $string;
}

but inlineing $tmp in the return line causes infinite loop...
)

Friendly-users added a commit to Friendly-users/sass that referenced this issue Jun 28, 2024
-----
It is inappropriate to include political and offensive content in public code repositories.

Public code repositories should be neutral spaces for collaboration and community, free from personal or political views that could alienate or discriminate against others. Political content, especially that which targets or disparages minority groups, can be harmful and divisive. It can make people feel unwelcome and unsafe, and it can create a hostile work environment.

Please refrain from adding such content to public code repositories.
---

sass#3000 sass#3001 sass#3002 sass#3003 sass#3004 sass#3005 sass#3006 sass#3007 sass#3008 sass#3009 sass#3010 sass#3011 sass#3012 sass#3013 sass#3014 sass#3015 sass#3016 sass#3017 sass#3018 sass#3019 sass#3020 sass#3021 sass#3022 sass#3023 sass#3024 sass#3025 sass#3026 sass#3027 sass#3028 sass#3029 sass#3030 sass#3031 sass#3032 sass#3033 #3034 sass#3035 sass#3036 sass#3037 sass#3038 sass#3039 #3040 sass#3041 sass#3042 sass#3043 sass#3044 sass#3045 sass#3046 sass#3047 sass#3048 sass#3049 sass#3050 sass#3051 sass#3052 sass#3053 sass#3054 sass#3055 sass#3056 sass#3057 sass#3058 sass#3059 sass#3060 sass#3061 sass#3062 sass#3063 sass#3064 sass#3065 sass#3066 sass#3067 sass#3068 sass#3069 sass#3070 sass#3071 sass#3072 sass#3073 sass#3074 sass#3075 sass#3076 sass#3077 sass#3078 #3079 sass#3080 sass#3081 sass#3082 sass#3083 sass#3084 sass#3085 sass#3086 sass#3087 sass#3088 sass#3089 sass#3090 sass#3091 sass#3092 sass#3093 sass#3094 sass#3095 #3096 sass#3097 sass#3098 sass#3099 sass#3100 sass#3101 sass#3102 sass#3103 sass#3104 sass#3105 #3106 sass#3107 sass#3108 sass#3109 sass#3110 sass#3111 sass#3112 sass#3113 sass#3114 sass#3115 sass#3116 sass#3117 sass#3118 sass#3119 sass#3120 sass#3121 sass#3122 sass#3123 sass#3124 sass#3125 sass#3126 sass#3127 sass#3128 sass#3129 sass#3130 sass#3131 sass#3132 sass#3133 sass#3134 sass#3135 sass#3136 sass#3137 sass#3138 sass#3139 sass#3140 sass#3141 sass#3142 sass#3143 sass#3144 sass#3145 sass#3146 sass#3147 sass#3148 sass#3149 sass#3150 sass#3151 sass#3152 sass#3153 sass#3154 sass#3155 sass#3156 sass#3157 sass#3158 sass#3159 sass#3160 sass#3161 sass#3162 sass#3163 sass#3164 sass#3165 sass#3166 sass#3167 sass#3168 sass#3169 sass#3170 sass#3171 sass#3172 sass#3173 sass#3174 sass#3175 sass#3176 sass#3177 sass#3178 sass#3179 sass#3180 sass#3181 sass#3182 sass#3183 sass#3184 sass#3185 sass#3186 sass#3187 sass#3188 sass#3189 sass#3190 sass#3191 sass#3192 sass#3193 sass#3194 sass#3195 sass#3196 sass#3197 sass#3198 sass#3199 sass#3200 sass#3201 sass#3202 sass#3203 sass#3204 sass#3205 sass#3206 sass#3207 sass#3208 sass#3209 sass#3210 sass#3211 sass#3212 sass#3213 sass#3214 sass#3215 sass#3216 sass#3217 sass#3218 sass#3219 sass#3220 sass#3221 sass#3222 sass#3223 sass#3224 sass#3225 sass#3226 sass#3227 sass#3228 sass#3229 sass#3230 sass#3231 sass#3232 sass#3233 sass#3234 sass#3235 sass#3236 sass#3237 sass#3238 sass#3239 sass#3240 sass#3241 sass#3242 sass#3243 sass#3244 sass#3245 sass#3246 sass#3247 sass#3248 sass#3249 #3250 sass#3251 sass#3252 sass#3253 sass#3254 sass#3255 sass#3256 sass#3257 sass#3258 sass#3259 sass#3260 sass#3261 sass#3262 sass#3263 sass#3264 sass#3265 sass#3266 sass#3267 sass#3268 sass#3269 sass#3270 sass#3271 sass#3272 sass#3273 sass#3274 sass#3275 sass#3276 sass#3277 sass#3278 sass#3279 sass#3280 sass#3281 sass#3282 sass#3283 sass#3284 sass#3285 sass#3286 sass#3287 sass#3288 sass#3289 sass#3290 sass#3291 sass#3292 sass#3293 sass#3294 sass#3295 sass#3296 sass#3297 sass#3298 #3299 sass#3300 sass#3301 sass#3302 sass#3303 sass#3304 sass#3305 sass#3306 sass#3307 sass#3308 sass#3309 sass#3310 sass#3311 sass#3312 sass#3313 #3314 sass#3315 sass#3316 sass#3317 sass#3318 sass#3319 sass#3320 sass#3321 sass#3322 sass#3323 sass#3324 sass#3325 sass#3326 sass#3327 sass#3328 sass#3329 sass#3330 sass#3331 sass#3332 sass#3333 sass#3334 sass#3335 sass#3336 sass#3337 sass#3338 sass#3339 sass#3340 sass#3341 sass#3342 sass#3343 sass#3344 sass#3345 sass#3346 sass#3347 sass#3348 sass#3349 sass#3350 sass#3351 sass#3352 sass#3353 sass#3354 sass#3355 #3356 sass#3357 sass#3358 sass#3359 sass#3360 sass#3361 sass#3362 sass#3363 sass#3364 sass#3365 sass#3366 sass#3367 sass#3368 sass#3369 #3370 sass#3371 sass#3372 sass#3373 sass#3374 sass#3375 sass#3376 sass#3377 sass#3378 sass#3379 sass#3380 sass#3381 sass#3382 sass#3383 #3384 sass#3385 sass#3386 sass#3387 sass#3388 #3389 sass#3390 sass#3391 sass#3392 sass#3393 sass#3394 sass#3395 sass#3396 sass#3397 sass#3398 sass#3399 sass#3400 sass#3401 sass#3402 sass#3403 sass#3404 sass#3405 #3406 sass#3407 sass#3408 sass#3409 sass#3410 sass#3411 sass#3412 sass#3413 sass#3414 sass#3415 sass#3416 sass#3417 sass#3418 sass#3419 sass#3420 sass#3421 sass#3422 sass#3423 sass#3424 sass#3425 sass#3426 sass#3427 sass#3428 sass#3429 sass#3430 sass#3431 sass#3432 sass#3433 sass#3434 sass#3435 sass#3436 sass#3437 sass#3438 sass#3439 sass#3440 sass#3441 sass#3442 sass#3443 sass#3444 sass#3445 sass#3446 sass#3447 sass#3448 sass#3449 sass#3450 sass#3451 sass#3452 sass#3453 sass#3454 sass#3455 sass#3456 sass#3457 sass#3458 sass#3459 sass#3460 sass#3461 sass#3462 sass#3463 sass#3464 sass#3465 sass#3466 sass#3467 sass#3468 sass#3469 sass#3470 sass#3471 sass#3472 sass#3473 sass#3474 sass#3475 sass#3476 sass#3477 sass#3478 sass#3479 sass#3480 sass#3481 sass#3482 sass#3483 sass#3484 sass#3485 sass#3486 sass#3487 sass#3488 sass#3489 sass#3490 sass#3491 sass#3492 #3493 sass#3494 sass#3495 sass#3496 sass#3497 sass#3498 sass#3499 sass#3500 sass#3501 sass#3502 sass#3503 sass#3504 sass#3505 sass#3506 sass#3507 sass#3508 sass#3509 sass#3510 sass#3511 sass#3512 sass#3513 sass#3514 sass#3515 sass#3516 sass#3517 sass#3518 sass#3519 sass#3520 sass#3521 sass#3522 sass#3523 sass#3524 sass#3525 sass#3526 sass#3527 sass#3528 sass#3529 sass#3530 sass#3531 sass#3532 sass#3533 #3534 sass#3535 sass#3536 sass#3537 sass#3538 sass#3539 sass#3540 sass#3541 sass#3542 sass#3543 sass#3544 sass#3545 #3546 sass#3547 sass#3548 sass#3549 sass#3550 sass#3551 sass#3552 sass#3553 sass#3554 sass#3555 sass#3556 sass#3557 sass#3558 #3559 sass#3560 sass#3561 sass#3562 sass#3563 sass#3564 sass#3565 sass#3566 sass#3567 sass#3568 sass#3569 sass#3570 sass#3571 sass#3572 sass#3573 sass#3574 sass#3575 sass#3576 sass#3577 sass#3578 sass#3579 sass#3580 sass#3581 sass#3582 sass#3583 sass#3584 sass#3585 sass#3586 sass#3587 sass#3588 sass#3589 sass#3590 sass#3591 sass#3592 sass#3593 sass#3594 sass#3595 sass#3596 sass#3597 sass#3598 sass#3599 sass#3600 sass#3601 sass#3602 sass#3603 sass#3604 sass#3605 sass#3606 sass#3607 sass#3608 sass#3609 sass#3610 sass#3611 sass#3612 sass#3613 sass#3614 sass#3615 sass#3616 sass#3617 sass#3618 sass#3619 sass#3620 sass#3621 sass#3622 sass#3623 sass#3624 sass#3625 sass#3626 sass#3627 sass#3628 sass#3629 sass#3630 sass#3631 sass#3632 sass#3633 sass#3634 sass#3635 sass#3636 sass#3637 sass#3638 sass#3639 sass#3640 sass#3641 sass#3642 sass#3643 sass#3644 sass#3645 sass#3646 sass#3647 sass#3648 sass#3649 sass#3650 sass#3651 sass#3652 sass#3653 sass#3654 sass#3655 sass#3656 sass#3657 sass#3658 sass#3659 sass#3660 sass#3661 #3662 sass#3663 sass#3664 sass#3665 sass#3666 sass#3667 sass#3668 sass#3669 sass#3670 sass#3671 sass#3672 sass#3673 sass#3674 sass#3675 sass#3676 sass#3677 sass#3678 sass#3679 sass#3680 sass#3681 sass#3682 sass#3683 sass#3684 sass#3685 sass#3686 sass#3687 sass#3688 sass#3689 #3690 sass#3691 sass#3692 sass#3693 sass#3694 sass#3695 sass#3696 sass#3697 sass#3698 sass#3699 sass#3700 sass#3701 sass#3702 sass#3703 sass#3704 sass#3705 sass#3706 sass#3707 sass#3708 sass#3709 sass#3710 sass#3711 sass#3712 sass#3713 sass#3714 sass#3715 sass#3716 sass#3717 sass#3718 sass#3719 sass#3720 sass#3721 sass#3722 sass#3723 sass#3724 sass#3725 sass#3726 sass#3727 sass#3728 sass#3729 sass#3730 sass#3731 sass#3732 sass#3733 sass#3734 sass#3735 sass#3736 sass#3737 sass#3738 sass#3739 sass#3740 sass#3741 sass#3742 sass#3743 sass#3744 sass#3745 sass#3746 sass#3747 sass#3748 sass#3749 sass#3750 sass#3751 sass#3752 sass#3753 sass#3754 sass#3755 sass#3756 sass#3757 sass#3758 sass#3759 sass#3760 sass#3761 sass#3762 sass#3763 sass#3764 sass#3765 sass#3766 sass#3767 sass#3768 sass#3769 sass#3770 sass#3771 sass#3772 sass#3773 sass#3774 sass#3775 sass#3776 sass#3777 sass#3778 sass#3779 sass#3780 sass#3781 sass#3782 sass#3783 sass#3784 sass#3785 sass#3786 sass#3787 sass#3788 sass#3789 sass#3790 sass#3791 sass#3792 sass#3793 sass#3794 sass#3795 sass#3796 sass#3797 sass#3798 sass#3799 sass#3800 sass#3801 sass#3802 sass#3803 sass#3804 sass#3805 sass#3806 sass#3807 sass#3808 sass#3809 sass#3810 sass#3811 sass#3812 sass#3813 sass#3814 sass#3815 sass#3816 sass#3817 sass#3818 sass#3819 sass#3820 sass#3821 sass#3822 sass#3823 sass#3824 sass#3825 sass#3826 sass#3827 sass#3828 sass#3829 sass#3830 sass#3831 sass#3832 sass#3833 sass#3834 sass#3835 sass#3836 sass#3837 sass#3838 sass#3839 sass#3840 sass#3841 sass#3842 sass#3843 sass#3844 sass#3845 sass#3846 sass#3847 sass#3848 sass#3849 sass#3850 sass#3851 sass#3852 sass#3853 sass#3854 sass#3855 sass#3856 sass#3857 sass#3858 sass#3859 sass#3860 sass#3861 sass#3862 sass#3863 sass#3864 sass#3865 sass#3866 #3867 sass#3868 sass#3869 sass#3870 sass#3871 sass#3872 sass#3873 sass#3874 sass#3875 sass#3876 sass#3877 sass#3878 sass#3879 sass#3880 sass#3881 sass#3882 sass#3883 sass#3884 sass#3885 sass#3886 sass#3887 sass#3888 sass#3889 sass#3890 sass#3891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info Blocked on user response
Projects
None yet
Development

No branches or pull requests

5 participants