Skip to content

Limit sass jobs as workaround for thread lockout issue in node-sass #104

@dnjstrom

Description

@dnjstrom

node-sass currently suffers from a long-running issue where too many file handles are opened concurrently resulting in the build never finishing since node-sass will use up all the threads and keep waiting for more. You can read about the specifics here: sass/node-sass#857

The issue can be mitigated by increasing the thread-pool using process.env.UV_THREADPOOL_SIZE = 128 // max size, but given a larger project, as in my case, you'll hit the ceiling eventually.

I discovered this issue when migrating to rollup from webpack which didn't display the same issue. This seems to be because sass-loader implements a workaround using a queue which limits the amount of concurrent workers. You can see the implementation here: https://github.com/webpack-contrib/sass-loader/blob/2529c0716b1bca321c22d16636b1385682b1c730/lib/loader.js#L14

Since the original issue is three years old and seems unlikely to get a resolution anytime soon, I would suggest that a workaround similar to sass-loader is implemented in the sass-importer.

Thoughts? Alternative solutions? 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions