question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use NextJS with Lazy-Loading

See original GitHub issue

Problem 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:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
nickbabcockcommented, Jul 10, 2022

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)

1reaction
AbhiPrasadcommented, Oct 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found