diff --git a/changelog.d/fixes/7051-turbopack-compression-ignoreissue.md b/changelog.d/fixes/7051-turbopack-compression-ignoreissue.md new file mode 100644 index 0000000000..017b5b8c78 --- /dev/null +++ b/changelog.d/fixes/7051-turbopack-compression-ignoreissue.md @@ -0,0 +1 @@ +- fix(build): extend the Turbopack `ignoreIssue` suppression to `open-sse/services/compression/**`, matching the `getModuleDir()` dynamic-path fs pattern already suppressed for `src/lib/agentSkills/**` in #6582, eliminating the remaining 610 "Overly broad patterns" warnings (#7051) diff --git a/next.config.mjs b/next.config.mjs index ac7197503c..b3f7887bb5 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -128,11 +128,25 @@ const nextConfig = { // expected diagnostic — suppress it here rather than fight the analyzer, // mirroring the isNextIntlExtractorDynamicImportWarning precedent below // for the webpack path. (#6582) + // open-sse/services/compression/ruleLoader.ts and + // .../engines/rtk/filterLoader.ts both define an identical + // getModuleDir() helper that walks up directories via + // path.resolve(anchor) + fs.existsSync(...) in a loop with a + // non-literal argument — the same dynamic-path fs access pattern as + // the agentSkills case above, but not covered by that narrower + // allowlist glob, so the "Overly broad patterns..." warning kept + // firing (610 times, once per entry point transitively importing the + // compression module). Same known-benign, bounded fs access; + // suppressed here rather than fought. (#7051, follow-up to #6582) ignoreIssue: [ { path: "**/src/lib/agentSkills/**", description: /Overly broad patterns can lead to build performance issues/, }, + { + path: "**/open-sse/services/compression/**", + description: /Overly broad patterns can lead to build performance issues/, + }, ], }, output: "standalone", diff --git a/tests/unit/next-config.test.ts b/tests/unit/next-config.test.ts index 29821fa4ec..9281175217 100644 --- a/tests/unit/next-config.test.ts +++ b/tests/unit/next-config.test.ts @@ -288,6 +288,30 @@ test("turbopack.ignoreIssue suppresses the agentSkills over-bundling warning (#6 assert.match(String(agentSkillsRule.description), /Overly broad patterns/); }); +test("turbopack.ignoreIssue suppresses the compression module over-bundling warning (#7051)", async () => { + // open-sse/services/compression/ruleLoader.ts and + // .../engines/rtk/filterLoader.ts both define an identical getModuleDir() + // helper that walks up directories via path.resolve(anchor) + + // fs.existsSync(...) in a loop with a non-literal argument — the same + // class of dynamic-path fs access that #6582 suppressed for + // src/lib/agentSkills/**, but that narrow allowlist glob didn't cover this + // module, so the warning kept firing (610 times) for every entry point + // transitively importing the compression module. This guards the config + // shape so the suppression rule isn't silently dropped in a future edit. + const { default: nextConfig } = await loadNextConfig("ignore-issue-compression"); + const rules = nextConfig.turbopack?.ignoreIssue; + + assert.ok(Array.isArray(rules), "expected turbopack.ignoreIssue to be an array"); + const compressionRule = rules.find((rule) => + String(rule.path).includes("open-sse/services/compression") + ); + assert.ok( + compressionRule, + "expected an ignoreIssue rule targeting open-sse/services/compression/**" + ); + assert.match(String(compressionRule.description), /Overly broad patterns/); +}); + test("optimizePackageImports excludes the internal @omniroute/open-sse workspace (build-OOM guard)", async () => { // Regression guard: adding the internal `@omniroute/open-sse` workspace to // optimizePackageImports makes Next.js resolve its entire barrel at build