Skip to content

Commit

Permalink
Fix global SCSS on Node.js <= 14 (#50185)
Browse files Browse the repository at this point in the history
Fixes #45052. See the comments and related issue thread.
  • Loading branch information
shuding authored May 30, 2023
1 parent 0539b9c commit 6318d50
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/next/src/build/webpack/config/blocks/css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,17 @@ export const css = curry(async function css(
// Source maps are required so that `resolve-url-loader` can locate
// files original to their source directory.
sourceMap: true,
sassOptions,
sassOptions: {
// The "fibers" option is not needed for Node.js 16+, but it's causing
// problems for Node.js <= 14 users as you'll have to manually install
// the `fibers` package:
// https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package
// https://github.com/vercel/next.js/issues/45052
// Since it's optional and not required, we'll disable it by default
// to avoid the confusion.
fibers: false,
...sassOptions,
},
additionalData: sassPrependData || sassAdditionalData,
},
},
Expand Down

0 comments on commit 6318d50

Please sign in to comment.