nextjs - 💡(How to fix) Fix Regression in Next.js 16.0.1: sassOptions.additionalData causes error when using --webpack flag, worked in 15.5.2 [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85870Fetched 2026-04-08 02:13:32
View on GitHub
Comments
3
Participants
4
Timeline
9
Reactions
0
Timeline (top)
commented ×3labeled ×2closed ×1issue_type_added ×1

Error Message

  1. An error occurs during the build process. Current Behavior: In version 16.0.1, adding the sassOptions.additionalData line immediately causes a build error. This is a regression, as the same configuration works without any issues in version 15.5.2.

Code Example

sassOptions: {
  additionalData: '@use "app/styles" as *;',
},

---

Can't find stylesheet to import.
  
1 │ @use "app/styles" as *;

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0
Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.10.0
Relevant Packages:
  "next": "^16.0.1",
  "react": "19.1.0",
  "react-dom": "19.1.0"
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/GlebKodrik/scss-nextjs/tree/master

To Reproduce

  1. Use Next.js version 16.0.1 with the --webpack flag.
  2. Add the following configuration to next.config.ts:
sassOptions: {
  additionalData: '@use "app/styles" as *;',
},
  1. Start the development server using next dev or make a production build with next build.
  2. An error occurs during the build process.
Can't find stylesheet to import.
1 │ @use "app/styles" as *;

Current vs. Expected behavior

Expected Behavior: The configuration with sassOptions.additionalData should work identically to version 15.5.2, where it successfully injects the global SCSS module.

Current Behavior: In version 16.0.1, adding the sassOptions.additionalData line immediately causes a build error. This is a regression, as the same configuration works without any issues in version 15.5.2.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0
Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.10.0
Relevant Packages:
  "next": "^16.0.1",
  "react": "19.1.0",
  "react-dom": "19.1.0"
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

CSS

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

Additional context

The issue is specific to the new version 16.0.1. Rolling back to 15.5.2 resolves the problem immediately.

The project uses the --webpack configuration flag.

The goal of the additionalData option is to globally import an SCSS module (app/styles) into every Sass file in the project.

extent analysis

TL;DR

The issue can likely be resolved by adjusting the sassOptions.additionalData configuration to correctly reference the global SCSS module in Next.js version 16.0.1.

Guidance

  • Verify that the app/styles module exists and is correctly referenced in the sassOptions.additionalData configuration.
  • Check the Next.js documentation for version 16.0.1 to ensure that the sassOptions.additionalData configuration is supported and correctly formatted.
  • Try updating the sassOptions.additionalData configuration to use a relative path or a path that is correctly resolved by Webpack.
  • Consider rolling back to Next.js version 15.5.2 as a temporary workaround, as the issue is specific to version 16.0.1.

Example

No code snippet is provided as the issue is related to configuration and not a specific code block.

Notes

The issue is specific to Next.js version 16.0.1 and may be related to changes in how Sass options are handled. The --webpack flag may also be contributing to the issue.

Recommendation

Apply workaround: Roll back to Next.js version 15.5.2, as it is known to work correctly with the sassOptions.additionalData configuration. This will allow the project to continue functioning while a more permanent solution is found for version 16.0.1.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING