Use NextJS with Lazy-Loading
See original GitHub issueProblem Statement
I want to reduce my bundle size by lazy-loading Sentry. Unfortunately the NextJS integration seems to do too much of the magic and I do not see how to implement Lazy Loading as described in the docs
The NextJS instrumentation injects a webpack loader and a @sentry/nextjs
import yet the lazy-loading documentation requires a script
tag.
Solution Brainstorm
Document how a NextJS user who scaffolded with the setup wizard can use lazy-loading.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Simplifying Lazy Loading in Next.js - Better Programming
Lazy loading is a great way to prevent needless content rendering on a page. By using it, you could minimize the initial load...
Read more >Lazy Loading Images In Next.js - DEV Community
Next.js comes default with an Image component. Lazy loading is enabled by default in the Next.js Image component. It is not only ...
Read more >NextJS-lazy-load - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >Lazy loading modules in Next.js - Flavio Copes
Lazy loading modules in Next.js ; import moment from 'moment' ; const Post = props => { ; return ( ; <div> ;...
Read more >Code splitting with dynamic imports in Next.js - web.dev
By default, Next.js splits your JavaScript into separate chunks for each route. When users load your application, Next.js only sends the code ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If my understanding is correct, seems like clients that don’t use tracing should be allowed to opt into a lazy loading setup.
Seems like this issue shouldn’t be closed if newer issues are being closed as a duplicate of this (and this isn’t resolved)
These flags are used to treeshake away sentry code for functionality that you might not be using, like debug logic or performance monitoring.
You don’t need to be a sentry contributor to use these, just need to set the flags in your webpack config!
We also bundle in a bunch of default functionality, you can also tree-shake away the functionality you don’t need by following the above linked doc.