Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

node-sass preventing node from exiting #2666

Closed
mogelbrod opened this issue May 9, 2019 · 4 comments
Closed

node-sass preventing node from exiting #2666

mogelbrod opened this issue May 9, 2019 · 4 comments

Comments

@mogelbrod
Copy link

  • NPM version (npm -v): 6.9.0
  • Node version (node -v): v12.1.0 and v10.15.3 tested
  • Node Process (node -p process.versions):
{
  node: '12.1.0',
  v8: '7.4.288.21-node.16',
  uv: '1.28.0',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.38.0',
  napi: '4',
  llhttp: '1.1.1',
  http_parser: '2.8.0',
  openssl: '1.1.1b',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
}
  • Node Platform (node -p process.platform): darwin (Mac OS X 10.14.3)
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"):
node-sass	4.12.0	(Wrapper)	[JavaScript]
libsass  	3.5.4	(Sass Compiler)	[C/C++]
  • npm node-sass versions (npm ls node-sass):
node-sass-hangs@1.0.0 .../node-sass-hangs
└── node-sass@4.12.0

I noticed that webpack builds of our project froze node without exiting if a JS error was encountered during the bundling. Manually calling process.exit() didn't work either. Debugging pointed towards node-sass being the culprit as the process exited when removing all scss imports from the webpack build. I've only been able to repro the issue when including most of the codebase, making it hard to create a minimal example.

Instead I found a similar issue with the same symptom with an example I was able to reproduce myself: nodejs/node#17872

Updated reproducible minimal example that should work with both node v12.1.0 and v10.*.

Help much appreciated!

@sass sass deleted a comment from ViieeS Jun 7, 2019
@saper saper self-assigned this Jun 9, 2019
@saper
Copy link
Member

saper commented Jun 9, 2019

First problem is that you never return from the importer properly. But even if you would do, it still hangs.

process.exit() is running while there are other things scheduled in the event loop. This is special with node-sass since we jump to native code and return to JavaScript as we need (for example for importers).

@saper
Copy link
Member

saper commented Jun 10, 2019

After some reading of the code this looks as a duplicate of #1048 to me

@saper
Copy link
Member

saper commented Jun 10, 2019

Looking at my proposed solutions at #857 (comment) I'd suggest bumping priority of sass/libsass#1108 with libsass developers... (as per sass/libsass#1892 (comment))

@saper
Copy link
Member

saper commented Oct 17, 2019

Closing in favour of #1048

@saper saper closed this as completed Oct 17, 2019
jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Implements equality for selector lists in a cleaner and more efficient manner.

Related issue: sass#2666 (likely fixed by this change but I haven't verified).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants