Skip to content

Build: SCSS imports from node_modules (tilde ~ and CSS modules) not resolved #1825

@james-elicx

Description

@james-elicx

This issue was created by an agent auditing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-06-08).

Problem

SCSS imports that resolve into node_modules are not handled: both the tilde (~package) import form and CSS-Module imports from within node_modules fail to build/render. Both suites are fully red (0 passing) across sass and sass-embedded.

Affected Test Suites

  • test/e2e/app-dir/scss/npm-import-tilde/npm-import-tilde.test.ts (2 failures — sass 1.54.0, sass-embedded 1.75.0; "should render the page")
  • test/e2e/app-dir/scss/nm-module/nm-module.test.ts (2 failures — sass 1.54.0, sass-embedded 1.75.0; "should render the page")

Estimated impact

~4 e2e failures across 2 suites.

Notes

Distinct from #1343 (SCSS variables leaking to LightningCSS) and the closed #1450 (url() emission). This is specifically node_modules/tilde import resolution in the SCSS pipeline.

Recommendation

  1. Reproduce with an app importing @import '~some-pkg/styles' and a .module.scss that lives in node_modules.
  2. Wire the SCSS resolver to resolve ~-prefixed and bare node_modules specifiers the way Next.js/webpack's sass-loader does.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions