Skip to content

fix(next): suppress webpack "Critical dependency" warning in dynamicImport#15534

Merged
AlessioGr merged 1 commit intomainfrom
fix/next-build-warnings-2
Feb 5, 2026
Merged

fix(next): suppress webpack "Critical dependency" warning in dynamicImport#15534
AlessioGr merged 1 commit intomainfrom
fix/next-build-warnings-2

Conversation

@AlessioGr
Copy link
Copy Markdown
Member

The Vitest-only branch in dynamicImport uses a bare import(importPath) which webpack still statically analyzes, even though it's behind a process.env.VITEST condition. This could cause a "Critical dependency: the request of a dependency is an expression" warning in Next.js projects. Adding /* webpackIgnore: true */ should fix this.

Additionally, this hides another sass deprecation warning

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@AlessioGr AlessioGr merged commit 6158489 into main Feb 5, 2026
154 checks passed
@AlessioGr AlessioGr deleted the fix/next-build-warnings-2 branch February 5, 2026 19:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 9, 2026

🚀 This is included in version v3.76.0

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 9, 2026

🚀 This is included in version v3.76.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants