dx: Add match logging to --debug-build-paths - #89334
Conversation
|
Cursor Agent can help with this pull request. Just |
a9d04dc to
47286df
Compare
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
1 similar comment
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
95443dd to
e75d4c9
Compare
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **399 kB** → **399 kB** ✅ -2 B80 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|
| throw new Error(`Pattern "${patterns.join(',')}" did not match any files`) | ||
| } | ||
|
|
||
| Log.info(`Pattern "${patterns.join(',')}" did match ${matches.length} files`) |
There was a problem hiding this comment.
| Log.info(`Pattern "${patterns.join(',')}" did match ${matches.length} files`) | |
| Log.info(`Pattern "${patterns.join(',')}" did match ${matches.length} file(s)`) |
Why is the number of files matched relevant?
There was a problem hiding this comment.
I witnessed cases where it didn't give "not matched" warnings, and it progressed. The final build output only included /_not-found. TBH, I want the whole list of matched files, but that seems too much, so the number of files is a middle ground.
| expect(buildResult.cliOutput).toContain('○ /dashboard') | ||
| expect(buildResult.cliOutput).toContain('/blog/[slug]') | ||
| expect(buildResult.cliOutput).not.toContain('/with-type-error') | ||
| expect(buildResult.cliOutput).not.toMatch(/[○ƒ] \/with-type-error/) |
There was a problem hiding this comment.
The danger here is that this assertion succeeds if we change the [○ƒ] icon but build the route. Why not keep the assertion?
e75d4c9 to
4c285ce
Compare
4c285ce to
d78b4c7
Compare
Failing test suitesCommit: 7d63592 | About building and testing Next.js
Expand output● app dir - basic › should have correct cache-control for SSR routes ● app dir - basic › should contain framework.json ● app dir - basic › outputs correct build-diagnostics.json ● app dir - basic › should have correct preferredRegion values in manifest ● app dir - basic › should work for catch-all edge page ● app dir - basic › should return normalized dynamic route params for catch-all edge page ● app dir - basic › should have correct searchParams and params (server) ● app dir - basic › should have correct searchParams and params (client) ● app dir - basic › should expose app source page on window.next.__internal_src_page for /dashboard ● app dir - basic › should expose app source page on window.next.__internal_src_page for /dynamic/category-1/id-2 ● app dir - basic › should expose app source page on window.next.__internal_src_page for /dashboard/another ● app dir - basic › should update window.next.__internal_src_page on app router transitions ● app dir - basic › should successfully detect app route during prefetch ● app dir - basic › should encode chunk path correctly ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should match redirects in pages correctly $path ● app dir - basic › should not apply client router filter on shallow ● app dir - basic › should not share edge workers ● app dir - basic › should generate build traces correctly ● app dir - basic › should use text/x-component for flight ● app dir - basic › should use text/x-component for flight with edge runtime ● app dir - basic › should return the ● app dir - basic › should return the ● app dir - basic › should pass props from getServerSideProps in root layout ● app dir - basic › should serve from pages ● app dir - basic › should serve dynamic route from pages ● app dir - basic › should serve from public ● app dir - basic › should serve from app ● app dir - basic › should ensure the suffix is at the end of the stream ● app dir - basic › should serve /index as separate page ● app dir - basic › should serve polyfills for browsers that do not support modules ● app dir - basic › should handle css imports in next/dynamic correctly ● app dir - basic › should include layouts when no direct parent layout ● app dir - basic › should not include parent when not in parent directory with route in directory ● app dir - basic › should use new root layout when provided ● app dir - basic › should not create new root layout when nested (optional) ● app dir - basic › should include parent document when no direct parent layout ● app dir - basic › should not include parent when not in parent directory ● app dir - basic › should serve nested parent ● app dir - basic › should serve dynamic parameter ● app dir - basic › should serve page as a segment name correctly ● app dir - basic › should include document html and body ● app dir - basic › should not serve when layout is provided but no folder index ● app dir - basic › should match partial parameters ● app dir - basic › rewrites › should support rewrites on initial load ● app dir - basic › rewrites › should support rewrites on client-side navigation from pages to app with existing pages path ● app dir - basic › rewrites › should support rewrites on client-side navigation ● app dir - basic › should not rerender layout when navigating between routes in the same layout ● app dir - basic › should handle hash in initial url ● app dir - basic › › should hard push ● app dir - basic › › should hard replace ● app dir - basic › › should soft push ● app dir - basic › › should soft replace ● app dir - basic › › should be soft for back navigation ● app dir - basic › › should be soft for forward navigation ● app dir - basic › › should allow linking from app page to pages page ● app dir - basic › › should navigate to pages dynamic route from pages page if it overlaps with an app page ● app dir - basic › › should push to external url ● app dir - basic › › should replace to external url ● app dir - basic › server components › should not serve .server.js as a path ● app dir - basic › server components › should not serve .client.js as a path ● app dir - basic › server components › should serve shared component ● app dir - basic › server components › dynamic routes › should only pass params that apply to the layout ● app dir - basic › server components › catch-all routes › should handle optional segments ● app dir - basic › server components › catch-all routes › should handle optional segments root ● app dir - basic › server components › catch-all routes › should handle optional catch-all segments link ● app dir - basic › server components › catch-all routes › should handle required segments ● app dir - basic › server components › catch-all routes › should handle required segments root as not found ● app dir - basic › server components › catch-all routes › should handle catch-all segments link ● app dir - basic › server components › should serve client component › should serve server-side ● app dir - basic › server components › should serve client component › should serve client-side ● app dir - basic › server components › should include client component layout with server component route › should include it server-side ● app dir - basic › server components › should include client component layout with server component route › should include it client-side ● app dir - basic › server components › Loading › should render loading.js in initial html for slow page ● app dir - basic › server components › Loading › should render loading.js in browser for slow page ● app dir - basic › server components › Loading › should render loading.js in initial html for slow layout ● app dir - basic › server components › Loading › should render loading.js in browser for slow layout ● app dir - basic › server components › Loading › should render loading.js in initial html for slow layout and page ● app dir - basic › server components › Loading › should render loading.js in browser for slow layout and page ● app dir - basic › server components › middleware › should strip internal query parameters from requests to middleware for rewrite ● app dir - basic › server components › middleware › should strip internal query parameters from requests to middleware for redirect ● app dir - basic › server components › next/router › should support router.back and router.forward ● app dir - basic › server components › client components › should have consistent query and params handling ● app dir - basic › searchParams prop › client component › should have the correct search params ● app dir - basic › searchParams prop › client component › should have the correct search params on rewrite ● app dir - basic › searchParams prop › client component › should have the correct search params on middleware rewrite ● app dir - basic › searchParams prop › server component › should have the correct search params ● app dir - basic › searchParams prop › server component › should have the correct search params on rewrite ● app dir - basic › searchParams prop › server component › should have the correct search params on middleware rewrite ● app dir - basic › template component › should render the template that holds state in a client component and reset on navigation ● app dir - basic › template component › should render the template that is a server component and rerender on navigation ● app dir - basic › known bugs › should support React cache › server component ● app dir - basic › known bugs › should support React cache › server component client-navigation ● app dir - basic › known bugs › should support React cache › client component ● app dir - basic › known bugs › should support React cache › client component client-navigation ● app dir - basic › known bugs › should support React cache › middleware overriding headers ● app dir - basic › known bugs › should support React fetch instrumentation › server component ● app dir - basic › known bugs › should support React fetch instrumentation › server component client-navigation ● app dir - basic › known bugs › should support React fetch instrumentation › client component ● app dir - basic › known bugs › should support React fetch instrumentation › client component client-navigation ● app dir - basic › known bugs › should not share flight data between requests ● app dir - basic › known bugs › should handle router.refresh without resetting state ● app dir - basic › known bugs › should handle as on next/link ● app dir - basic › known bugs › should handle next/link back to initially loaded page ● app dir - basic › known bugs › should not do additional pushState when already on the page ● app dir - basic › next/script › should support next/script and render in correct order ● app dir - basic › next/script › should pass on extra props for beforeInteractive scripts with a src prop ● app dir - basic › next/script › should pass on extra props for beforeInteractive scripts without a src prop ● app dir - basic › next/script › should insert preload tags for beforeInteractive and afterInteractive scripts ● app dir - basic › next/script › should load stylesheets for next/scripts ● app dir - basic › next/script › should pass ● app dir - basic › next/script › should pass manual ● app dir - basic › next/script › should pass manual ● app dir - basic › next/script › should pass nonce when using next/font ● app dir - basic › data fetch with response over 16KB with chunked encoding › should load page when fetching a large amount of data ● app dir - basic › bootstrap scripts › should only bootstrap with one script, prinitializing the rest ● app dir - basic › bootstrap scripts › should successfully bootstrap even when using CSP |
When glob patterns match files, log 'Pattern "..." did match N files' to provide feedback on successful pattern matching.
The new log message 'Pattern "..." did match N files' includes the pattern itself, which may contain excluded paths like '/with-type-error' as part of negation patterns. Update test assertions to check for the route format in the build output (e.g., '○ /route' or 'ƒ /route') rather than just checking if the path appears anywhere in the output.
- Fix double-wrapped error: Move the 'no matches' check outside the try-catch block so it doesn't get re-wrapped by the glob error handler - Remove accidentally committed build artifact: Delete test/integration/errors-on-output-to-static/static/types/routes.d.ts - Update test assertions to check for route format (○/ƒ prefix) when verifying excluded routes, since log message shows full pattern
de07e83 to
7d63592
Compare
Merging this PR will not alter performance
Comparing Footnotes
|


Why?
When using
--debug-build-paths, the intention is that I expect to match patterns. If it doesn't, I want to know right away, but currently, it just warns and proceeds to build the whole app. Especially when you run on agents, it's better to fail fast and save tokens.Also, it didn't mention how many files had matched. Sometimes there's a case where just
/_not-foundis built and not the files I intended. Displaying the whole files would be spam, so just list how many files it matched so I can quickly check whether it's working as intended.How?
Supersedes #88909