Commit 35783aa
committed
fix: resolve Windows SCSS import failures in dev server
On Windows, Next.js's bundled sass-loader fails to resolve SCSS imports
from node_modules due to path resolution issues with resolve-url-loader
and the legacy sass API.
This patch to next@16.2.3's compiled sass-loader makes three changes:
1. Forces modern-compiler API instead of legacy, enabling loadPaths support
2. Disables webpackImporter (defaults to false) so sass uses its own
native resolver instead of webpack's, which loses path context on Windows
3. Adds node_modules to loadPaths so package-style @import statements
like @primer/css and @primer/primitives resolve correctly
Also adds loadPaths to sassOptions in next.config.ts as the proper
configuration surface for this fix.
Fixes dev server startup on Windows (native, no WSL required).
Tested on Windows 11 with Node.js 24.1 parent affd6e0 commit 35783aa
2 files changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
0 commit comments