embedded-host-node icon indicating copy to clipboard operation
embedded-host-node copied to clipboard

Errors when using with sass-loader

Open VioletFlare opened this issue 1 year ago • 3 comments

Hello,

I have a pretty large codebase to compile and I was trying sass-embedded. When I am running webpack with the following config:

					{
						loader: 'sass-loader',
						options: {
							sassOptions: {
								sourceMap: true,
								includePaths: [path.resolve(__dirname, 'Develop', 'Styles'), path.resolve(__dirname, 'WebComponents')],
							},
							implementation: require('sass-embedded')
						}
					}

Dart errors with the following error:

> webpack --config webpack.configs.dev.js --watch

../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22
../../runtime/bin/eventhandler_win.cc: 318: error: Failed to start read file thread 22

It looks like evenhandler_win.cc is a dart file.

https://github.com/dart-lang/sdk/blob/5e61fe62bc5179cf3c032a2362182dd7a5ed7a38/runtime/bin/eventhandler_win.cc#L9

VioletFlare avatar May 08 '24 14:05 VioletFlare

Can you provide a clean reproduction of this, ideally only using the Sass embedded API without the WebPack loader around it?

nex3 avatar May 08 '24 20:05 nex3

Can you provide a clean reproduction of this, ideally only using the Sass embedded API without the WebPack loader around it?

Sorry, I cannot make a reproducible example using only sass-embedded api right now. However I have something that might aid in the reproduction of this case or which might serve as a temporary solution.

While I was running the webpack build using sass-embedded, the memory usage grew to 8 GB between the various node processes and dart executables running and got to a point where no memory was available. At some point I was running out of physical memory, my disk was nearly full (had nearly 250 MB left), after cleaning my disk I am not running into this issue anymore.

I forgot to mention I am using windows :)

So it seems as something related to Windows Virtual Memory management or Dart itself.

VioletFlare avatar May 09 '24 13:05 VioletFlare

That sounds like it may be an issue with sass-loader spawning too many instances of sass-embedded concurrently. This should be fixed by https://github.com/webpack-contrib/sass-loader/pull/1195, but if you're using a version of WebPack that includes that PR you might want to file an issue there explaining the problem.

nex3 avatar May 09 '24 20:05 nex3