Next.js experimental bundle analyzer feedback #86731
Replies: 20 comments 32 replies
-
Beta Was this translation helpful? Give feedback.
-
|
I am getting this: |
Beta Was this translation helpful? Give feedback.
-
|
Love this addition! Is there a way for userland to run a hosted instance of its bundle analyzer, like you're doing in your demo https://nextjs.org/blog/next-16-1#nextjs-bundle-analyzer-experimental |
Beta Was this translation helpful? Give feedback.
-
|
Not sure what the expectation here is, but reading through the release notes for the 16.1 release it looks like you should just be able to run > @**/nextjs@0.1.0 analyze /Users/**/apps/nextjs
> next experimental-analyze
Invalid project directory provided, no such directory: /Users/**/apps/nextjs/experimental-analyzeOr, using the > @**/nextjs@0.1.0 analyze /Users/**/apps/nextjs
> next experimental-analyze --serve
error: unknown option '--serve'Is it still Canary only? |
Beta Was this translation helpful? Give feedback.
-
|
Nice, the analyzer was something I was eager to use, thank you for that :) I assune at some point the Next.js DevTools MCP will make it possible for the ai to bundles by route, using a new MCP function that is to be released!? In the meantime would it be possible to put the params into the url, like the current route, compressed or not, ... this way the ai could access the output directly and we could prompt our agent to analyze the packages of a route and then create a markdown document with optimization suggestions. Currently the ai only sees the default route when it open localhost:4000 and it can not navigate around. |
Beta Was this translation helpful? Give feedback.
-
|
I just read through the 16.1 release notes, and checked out the experimental bundle analyzer's demo link: https://turbopack-bundle-analyzer-demo.vercel.sh/ If you go to the markdownPath, and show the Client data, it seems like it's including eslint in the bundle size. Is it just used for SSR, or is it actually in the client bundle? I know it's experimental, but is there an easy way to check? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
can't launch 2 analysers at the same time because they try to use the same port it would be nice if it could fail over to a different port similar to the regular next.js dev server:
|
Beta Was this translation helpful? Give feedback.
-
|
This is a revelation! Was nearly impossible for us to figure out (except through binary search) why certain modules were getting imported. Now it's easy! Thanks so much. One thing that would be useful (or perhaps I'm misunderstanding?) is removing the async loaded modules from display with a checkbox. We've done some optimizations so those modules are not loaded on the first page load so currently including them gives a somewhat inflated view of the route size. Kudos again to the team, huge. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Getting an error: Analyzing a production build...
Unhandled Rejection: [Error: Expected process result to be a module, but it could not be processed
Debug info:
- Execution of write_analyze_data_with_issues_operation failed
- Execution of write_analyze_data_with_issues_operation_inner failed
- Execution of Project::emit_all_output_assets failed
- Execution of *emit_assets failed
- Execution of all_assets_from_entries_operation failed
- Execution of *all_assets_from_entries failed
- Execution of get_analyze_data_operation failed
- Execution of *AnalyzeDataOutputAsset::new failed
- Execution of output_of_endpoints failed
- Execution of <InstrumentationEndpoint as Endpoint>::output failed
- Execution of InstrumentationEndpoint::output_assets failed
- Execution of InstrumentationEndpoint::node_chunk failed
- Execution of *<NodeJsChunkingContext as ChunkingContext>::entry_chunk_group failed
- Execution of Project::server_chunking_context failed
- Execution of *get_server_chunking_context failed
- Execution of Project::module_ids failed
- Execution of whole_app_module_graph_operation failed
- Execution of *ModuleGraph::from_single_graph failed
- Execution of *SingleModuleGraph::new_with_entries failed
- Execution of Project::get_all_entries failed
- Execution of <AppEndpoint as Endpoint>::entries failed
- Execution of get_app_page_entry failed
- Execution of ProcessResult::module failed
- Expected process result to be a module, but it could not be processed] {
code: 'GenericFailure' |
Beta Was this translation helpful? Give feedback.
-
|
Getting this error bunx next experimental-analyze |
Beta Was this translation helpful? Give feedback.
-
|
Anyway to check which js bundles were lazy loaded vs which were loaded when route renders? This info would be helpful when optimizing for initial page loads. |
Beta Was this translation helpful? Give feedback.
-
|
It would be very helpful if I can compare two reports somehow, for example:
|
Beta Was this translation helpful? Give feedback.
-
|
Any tip to overcome the " code: 'GenericFailure'" error described above ? Not being able to analyse the bundle size is quite a problem for serious web applications... |
Beta Was this translation helpful? Give feedback.
-
|
I had a problem with the server giving me 500 and no output. I ended up generating only output and starting the server myself. This is how I see analyze results now: |
Beta Was this translation helpful? Give feedback.
-
|
hard to tell if this has been mentioned. I recently optimized a bundle using the webpack based solution. I had discovered that in our initial app chunk we were importing all of a module and only using one import. in this new analyzer, is there a way to see the initial entry chunks too? I only seem to see routes? |
Beta Was this translation helpful? Give feedback.
-
|
With the following import createMDX from '@next/mdx'
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
reactCompiler: true,
}
const withMDX = createMDX({
options: {
remarkPlugins: ['remark-gfm'],
rehypePlugins: [],
},
})
export default withMDX(nextConfig)I get: I guess it's due to |
Beta Was this translation helpful? Give feedback.
-
|
I'm missing the option to not filter by route. (Trying to investigate why Turbopack is duplicating so many chunks across the app - the service worker cache is around 15x bigger when using Turbopack on Next.js 6.1.3.) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feedback thread for the new bundle analyzer that integrates with Turbopack's module graph.
Beta Was this translation helpful? Give feedback.
All reactions