Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example update: with-sentry-simple #8684

Merged
merged 5 commits into from
Sep 17, 2019
Merged

Example update: with-sentry-simple #8684

merged 5 commits into from
Sep 17, 2019

Conversation

WestonThayer
Copy link
Contributor

@WestonThayer WestonThayer commented Sep 10, 2019

  • Adds more test cases for different server and client-side exceptions (each is described in index.js
  • Allows capturing more server-side exceptions by overriding _error.js and using Sentry.captureException() within (this should fix with-sentry-simple example doesn't work in server although it says it does. #8106)
  • Use @sentry/node on the server to capture even more server-side exceptions
  • Rely on Next.js's built-in React Error Boundary instead of creating our own in _app.js

Blocked: While server-side exceptions work fine locally, when deployed with target: "serverless" on Zeit Now, the lambda exits before Sentry gets a chance to send. Tracking via #8685

Weston Thayer added 4 commits September 9, 2019 14:32
- Adds test cases for several server and client-side exceptions
- Allows capturing more server-side exceptions by overriding _error.js and using Sentry.captureException() within
- Use @sentry/node on the server
- Rely on Next.js's React Error Boundary instead of creating our own in _app.js
Found some differences while testing in production
@ijjk
Copy link
Member

ijjk commented Sep 10, 2019

Stats from current PR

Default Server Mode
General
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
buildDuration 21.8s 21.7s -20ms
nodeModulesSize 42.4 MB 42.4 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.js 18.2 kB 18.2 kB
main-HASH.js gzip 6.64 kB 6.64 kB
webpack-HASH.js 1.53 kB 1.53 kB
webpack-HASH.js gzip 746 B 746 B
d6c641065c1a..2b8407376.js 21.9 kB N/A N/A
d6c641065c1a..7376.js gzip 7.81 kB N/A N/A
e09f96069f19..799a4e38e.js 43.1 kB N/A N/A
e09f96069f19..e38e.js gzip 15.4 kB N/A N/A
framework.5b..dbaff70d3.js 125 kB 125 kB
framework.5b..70d3.js gzip 39.4 kB 39.4 kB
7a7ef268f1e4..799a4e38e.js N/A 43.1 kB N/A
7a7ef268f1e4..e38e.js gzip N/A 15.4 kB N/A
90ca70a592be..2b8407376.js N/A 21.9 kB N/A
90ca70a592be..7376.js gzip N/A 7.81 kB N/A
Overall change 210 kB 210 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.module.js 16.6 kB 16.6 kB
main-HASH.module.js gzip 6.38 kB 6.38 kB
webpack-HASH.module.js 1.53 kB 1.53 kB
webpack-HASH..dule.js gzip 746 B 746 B
e09f96069f19..f0.module.js 45.5 kB N/A N/A
e09f96069f19..dule.js gzip 16.5 kB N/A N/A
framework.5b..d3.module.js 125 kB 125 kB
framework.5b..dule.js gzip 39.4 kB 39.4 kB
7a7ef268f1e4..f0.module.js N/A 45.5 kB N/A
7a7ef268f1e4..dule.js gzip N/A 16.5 kB N/A
Overall change 189 kB 189 kB
Client Pages
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.js 1.83 kB 1.83 kB
_app.js gzip 883 B 883 B
_error.js 12.1 kB 12.1 kB
_error.js gzip 4.74 kB 4.74 kB
hooks.js 12.7 kB 12.7 kB
hooks.js gzip 4.81 kB 4.81 kB
index.js 343 B 343 B
index.js gzip 237 B 237 B
link.js 8.14 kB 8.14 kB
link.js gzip 3.49 kB 3.49 kB
routerDirect.js 433 B 433 B
routerDirect.js gzip 296 B 296 B
withRouter.js 444 B 444 B
withRouter.js gzip 294 B 294 B
Overall change 36 kB 36 kB
Client Pages Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.module.js 1.73 kB 1.73 kB
_app.module.js gzip 841 B 841 B
_error.module.js 23.3 kB 23.3 kB
_error.module.js gzip 8.6 kB 8.6 kB
hooks.module.js 1.55 kB 1.55 kB
hooks.module.js gzip 804 B 804 B
index.module.js 319 B 319 B
index.module.js gzip 238 B 238 B
link.module.js 8.52 kB 8.52 kB
link.module.js gzip 3.67 kB 3.67 kB
routerDirect.module.js 419 B 419 B
routerDirect..dule.js gzip 294 B 294 B
withRouter.module.js 429 B 429 B
withRouter.m..dule.js gzip 293 B 293 B
Overall change 36.2 kB 36.2 kB
Client Build Manifests
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_buildManifest.js 81 B 81 B
_buildManifest.js gzip 61 B 61 B
_buildManifest.module.js 81 B 81 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 162 B 162 B
Rendered Page Sizes
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
index.html 3.75 kB 3.75 kB
index.html gzip 961 B 960 B -1 B
link.html 3.79 kB 3.79 kB
link.html gzip 970 B 969 B -1 B
withRouter.html 3.8 kB 3.8 kB
withRouter.html gzip 956 B 954 B -2 B
Overall change 11.3 kB 11.3 kB

Diffs

Diff for index.html
@@ -6,9 +6,9 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/index.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/index.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
@@ -16,9 +16,9 @@
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -26,18 +26,18 @@
         <div id="__next">Hello world 👋</div>
         <script id="__NEXT_DATA__" type="application/json"
         crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/","query":{},"buildId":"8mRD6hblwxg1cKBlZ_s5W"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/","query":{},"buildId":"PDurvl3WrNv-dVtS3Sm_l"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/index.js"
+        <script async="" data-next-page="/" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/index.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/index.module.js"
+        <script async="" data-next-page="/" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/index.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
@@ -51,15 +51,15 @@
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/378f779dcc5576ad17187046632d154bc185d8b6.155621535702fe040780.js"
+        <script src="/_next/static/chunks/a47b21b5a04498271dee62b801e10e315994953e.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>
Diff for link.html
@@ -6,19 +6,19 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/link.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/link.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -29,18 +29,18 @@
             </div>
         </div>
         <script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/link","query":{},"buildId":"8mRD6hblwxg1cKBlZ_s5W"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/link","query":{},"buildId":"PDurvl3WrNv-dVtS3Sm_l"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/link" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/link.js"
+        <script async="" data-next-page="/link" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/link.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/link" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/link.module.js"
+        <script async="" data-next-page="/link" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/link.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
@@ -50,19 +50,19 @@
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/378f779dcc5576ad17187046632d154bc185d8b6.155621535702fe040780.js"
+        <script src="/_next/static/chunks/a47b21b5a04498271dee62b801e10e315994953e.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/main-26e9253859bbcb659328.js"
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>
Diff for withRouter.html
@@ -6,19 +6,19 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/withRouter.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/withRouter.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -27,18 +27,18 @@
             <div>I use withRouter</div>
         </div>
         <script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"8mRD6hblwxg1cKBlZ_s5W"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"PDurvl3WrNv-dVtS3Sm_l"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/withRouter" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/withRouter.js"
+        <script async="" data-next-page="/withRouter" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/withRouter.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/withRouter" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/withRouter.module.js"
+        <script async="" data-next-page="/withRouter" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/withRouter.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
@@ -48,19 +48,19 @@
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/378f779dcc5576ad17187046632d154bc185d8b6.155621535702fe040780.js"
+        <script src="/_next/static/chunks/a47b21b5a04498271dee62b801e10e315994953e.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/c46cde4798528ee0bbd76e77383cf52014f61a63.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/cc3f064c137a2f09e6635644bdee3b733d30065a.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/main-26e9253859bbcb659328.js"
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/8mRD6hblwxg1cKBlZ_s5W/_buildManifest.module.js"
+        <script src="/_next/static/PDurvl3WrNv-dVtS3Sm_l/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>

Serverless Mode
General
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
buildDuration 21.8s 22.2s ⚠️ +444ms
nodeModulesSize 42.4 MB 42.4 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.js 18.2 kB 18.2 kB
main-HASH.js gzip 6.64 kB 6.64 kB
webpack-HASH.js 1.53 kB 1.53 kB
webpack-HASH.js gzip 746 B 746 B
b1e2a6fd0097..799a4e38e.js 43.1 kB N/A N/A
b1e2a6fd0097..e38e.js gzip 15.4 kB N/A N/A
ecc4254e6c97..2b8407376.js 21.9 kB N/A N/A
ecc4254e6c97..7376.js gzip 7.81 kB N/A N/A
framework.5b..dbaff70d3.js 125 kB 125 kB
framework.5b..70d3.js gzip 39.4 kB 39.4 kB
0e136619ff89..799a4e38e.js N/A 43.1 kB N/A
0e136619ff89..e38e.js gzip N/A 15.4 kB N/A
212955221c5b..2b8407376.js N/A 21.9 kB N/A
212955221c5b..7376.js gzip N/A 7.81 kB N/A
Overall change 210 kB 210 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.module.js 16.6 kB 16.6 kB
main-HASH.module.js gzip 6.38 kB 6.38 kB
webpack-HASH.module.js 1.53 kB 1.53 kB
webpack-HASH..dule.js gzip 746 B 746 B
b1e2a6fd0097..f0.module.js 45.5 kB N/A N/A
b1e2a6fd0097..dule.js gzip 16.5 kB N/A N/A
framework.5b..d3.module.js 125 kB 125 kB
framework.5b..dule.js gzip 39.4 kB 39.4 kB
0e136619ff89..f0.module.js N/A 45.5 kB N/A
0e136619ff89..dule.js gzip N/A 16.5 kB N/A
Overall change 189 kB 189 kB
Client Pages
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.js 1.83 kB 1.83 kB
_app.js gzip 883 B 883 B
_error.js 12.1 kB 12.1 kB
_error.js gzip 4.74 kB 4.74 kB
hooks.js 12.7 kB 12.7 kB
hooks.js gzip 4.81 kB 4.81 kB
index.js 343 B 343 B
index.js gzip 237 B 237 B
link.js 8.14 kB 8.14 kB
link.js gzip 3.49 kB 3.49 kB
routerDirect.js 433 B 433 B
routerDirect.js gzip 296 B 296 B
withRouter.js 444 B 444 B
withRouter.js gzip 294 B 294 B
Overall change 36 kB 36 kB
Client Pages Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.module.js 1.73 kB 1.73 kB
_app.module.js gzip 841 B 841 B
_error.module.js 23.3 kB 23.3 kB
_error.module.js gzip 8.6 kB 8.6 kB
hooks.module.js 1.55 kB 1.55 kB
hooks.module.js gzip 804 B 804 B
index.module.js 319 B 319 B
index.module.js gzip 238 B 238 B
link.module.js 8.52 kB 8.52 kB
link.module.js gzip 3.67 kB 3.67 kB
routerDirect.module.js 419 B 419 B
routerDirect..dule.js gzip 294 B 294 B
withRouter.module.js 429 B 429 B
withRouter.m..dule.js gzip 293 B 293 B
Overall change 36.2 kB 36.2 kB
Client Build Manifests
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_buildManifest.js 81 B 81 B
_buildManifest.js gzip 61 B 61 B
_buildManifest.module.js 81 B 81 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 162 B 162 B
Serverless bundles
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_error.js 247 kB 247 kB
_error.js gzip 66.2 kB 66.2 kB ⚠️ +16 B
hooks.html 3.86 kB 3.86 kB
hooks.html gzip 986 B 986 B
index.js 248 kB 248 kB
index.js gzip 66.4 kB 66.5 kB ⚠️ +50 B
link.js 255 kB 255 kB
link.js gzip 68.5 kB 68.5 kB ⚠️ +20 B
routerDirect.js 249 kB 249 kB
routerDirect.js gzip 66.5 kB 66.5 kB ⚠️ +48 B
withRouter.js 249 kB 249 kB
withRouter.js gzip 66.5 kB 66.6 kB ⚠️ +40 B
Overall change 1.25 MB 1.25 MB
@leerob
Copy link
Member

leerob commented Sep 10, 2019

This is very well researched and incredibly in-depth! 😍

Do you think it's possible this could be extracted as it's own package rather than an example? The main reason being: I don't view this as "simple". When we have to give 10+ examples and lots of documentation/comments, it adds another layer of complexity that most people probably don't care about.

Next.js is known for it's exceptional developer experience, so maybe there's a way we can make this as simple as adding a package and putting the DSN inside of next.config.js?

Is it possible to override _app and _error from an external package? If so, I'd be happy to work with you on creating an NPM package for this and getting some solid tests around it.

@WestonThayer
Copy link
Contributor Author

WestonThayer commented Sep 10, 2019

Thanks! No, I don’t know of a way for a next.config plug-in to provide _app and _error features. Even though we have access to the Webpack config, there’s a lot of Next internal code that checks for the presence of those files in the pages folder. Plus if a dev wants to override those files to do their own thing, it would have to integrate well with their code.

I share your desire for a good dev UX. To review: if you remove the test pages, there’s 4 things a dev needs to do:

  1. Use @zeit/next-source-maps
  2. Override the webpack config to swap @sentry/node
  3. Provide an _error.js that captures exceptions
  4. Provide an _app.js that initializes Sentry

3 and 4 are made slightly more complex by the workaround for #8592. My code for 3 is somewhat lengthy, I’ll bet it could be made shorter. Maybe there’s other changes we can make to improve the readability / speed of comprehension as well. I found the test pages really helpful for developing the sample, but I could see how they clutter things.

The last complex bit is documenting how Sentry deals with source maps, and what you’d need to do to get server-side maps working. The Node script I described would be especially well suited to an npm package.

More ideas:

Open to other ideas too. Some automated tests would be great. None of this is really specific to Sentry either. You’d face similar issues implementing any sort of error tracking solution.

@huv1k
Copy link
Contributor

huv1k commented Sep 10, 2019

Hey @WestonThayer, thanks for your update and PR. We right now have new RFC in drafting for handling errors reporting in Next.js. You approach is really nice, but it's not possible to handle all kind of errors. For example errors in API routes act differently and it needs a proper solution. It could work to have a wrapper around all API routes, but this is not DX we are looking for. This RFC should be public this week 😇

@WestonThayer
Copy link
Contributor Author

That’s awesome news @huv1k! That’s a great point about API routes. I also realized that my approach likely wouldn’t catch any exceptions thrown from Next.js itself, like if there was a bug in the webpack serverless loader, because Sentry.init isn’t called until _app is loaded.

I had played around with injecting the Sentry init as an entry in the webpack build (similar to the polyfills example), but it was really tricky figuring out which bundle it should prepend. A framework-supported approach here would be most welcome 🙏

@ijjk
Copy link
Member

ijjk commented Sep 10, 2019

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
buildDuration 23s 23.1s ⚠️ +83ms
nodeModulesSize 42.4 MB 42.4 MB -825 B
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.js 18.3 kB 18.2 kB -46 B
main-HASH.js gzip 6.65 kB 6.64 kB -11 B
webpack-HASH.js 1.53 kB 1.53 kB
webpack-HASH.js gzip 746 B 746 B
00721ce64147..799a4e38e.js 43.1 kB N/A N/A
00721ce64147..e38e.js gzip 15.4 kB N/A N/A
222ef5c80f96..2b8407376.js 21.9 kB N/A N/A
222ef5c80f96..7376.js gzip 7.81 kB N/A N/A
framework.5b..dbaff70d3.js 125 kB 125 kB
framework.5b..70d3.js gzip 39.4 kB 39.4 kB
61b3f89dfd08..799a4e38e.js N/A 43.1 kB N/A
61b3f89dfd08..e38e.js gzip N/A 15.4 kB N/A
e10d0d62b303..2b8407376.js N/A 21.9 kB N/A
e10d0d62b303..7376.js gzip N/A 7.81 kB N/A
Overall change 210 kB 210 kB -46 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.module.js 16.6 kB 16.6 kB -50 B
main-HASH.module.js gzip 6.4 kB 6.38 kB -12 B
webpack-HASH.module.js 1.53 kB 1.53 kB
webpack-HASH..dule.js gzip 746 B 746 B
00721ce64147..f0.module.js 45.5 kB N/A N/A
00721ce64147..dule.js gzip 16.5 kB N/A N/A
framework.5b..d3.module.js 125 kB 125 kB
framework.5b..dule.js gzip 39.4 kB 39.4 kB
61b3f89dfd08..f0.module.js N/A 45.5 kB N/A
61b3f89dfd08..dule.js gzip N/A 16.5 kB N/A
Overall change 189 kB 189 kB -50 B
Client Pages
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.js 1.83 kB 1.83 kB
_app.js gzip 883 B 883 B
_error.js 12.1 kB 12.1 kB
_error.js gzip 4.74 kB 4.74 kB
hooks.js 12.7 kB 12.7 kB
hooks.js gzip 4.81 kB 4.81 kB
index.js 343 B 343 B
index.js gzip 237 B 237 B
link.js 8.14 kB 8.14 kB
link.js gzip 3.49 kB 3.49 kB
routerDirect.js 433 B 433 B
routerDirect.js gzip 296 B 296 B
withRouter.js 444 B 444 B
withRouter.js gzip 294 B 294 B
Overall change 36 kB 36 kB
Client Pages Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.module.js 1.73 kB 1.73 kB
_app.module.js gzip 841 B 841 B
_error.module.js 23.3 kB 23.3 kB
_error.module.js gzip 8.6 kB 8.6 kB
hooks.module.js 1.55 kB 1.55 kB
hooks.module.js gzip 804 B 804 B
index.module.js 319 B 319 B
index.module.js gzip 238 B 238 B
link.module.js 8.52 kB 8.52 kB
link.module.js gzip 3.67 kB 3.67 kB
routerDirect.module.js 419 B 419 B
routerDirect..dule.js gzip 294 B 294 B
withRouter.module.js 429 B 429 B
withRouter.m..dule.js gzip 293 B 293 B
Overall change 36.2 kB 36.2 kB
Client Build Manifests
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_buildManifest.js 81 B 81 B
_buildManifest.js gzip 61 B 61 B
_buildManifest.module.js 81 B 81 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 162 B 162 B
Rendered Page Sizes
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
index.html 3.75 kB 3.75 kB
index.html gzip 961 B 959 B -2 B
link.html 3.79 kB 3.79 kB
link.html gzip 971 B 967 B -4 B
withRouter.html 3.8 kB 3.8 kB
withRouter.html gzip 958 B 954 B -4 B
Overall change 11.3 kB 11.3 kB

Diffs

Diff for main-HASH.js
@@ -490,7 +490,7 @@ function () {
   var _ref2 = (0, _asyncToGenerator2["default"])(
   /*#__PURE__*/
   _regeneratorRuntime.mark(function _callee(_temp) {
-    var _ref, passedWebpackHMR, initialErr, _require, isValidElementType, initialAsPath, renderCtx;
+    var _ref, passedWebpackHMR, initialErr, _require, isValidElementType, renderCtx;
 
     return _regeneratorRuntime.wrap(function _callee$(_context) {
       while (1) {
@@ -547,10 +547,7 @@ function () {
             return window.__NEXT_PRELOADREADY(dynamicIds);
 
           case 22:
-            // if auto prerendered and dynamic route wait to update asPath
-            // until after mount to prevent hydration mismatch
-            initialAsPath = (0, _isDynamic.isDynamicRoute)(page) && data.nextExport ? page : asPath;
-            exports.router = router = (0, _router.createRouter)(page, query, initialAsPath, {
+            exports.router = router = (0, _router.createRouter)(page, query, asPath, {
               initialProps: props,
               pageLoader: pageLoader,
               App: App,
@@ -580,7 +577,7 @@ function () {
             render(renderCtx);
             return _context.abrupt("return", emitter);
 
-          case 27:
+          case 26:
           case "end":
             return _context.stop();
         }
Diff for main-HASH.module.js
@@ -545,12 +545,9 @@ function () {
 
     if (window.__NEXT_PRELOADREADY) {
       yield window.__NEXT_PRELOADREADY(dynamicIds);
-    } // if auto prerendered and dynamic route wait to update asPath
-    // until after mount to prevent hydration mismatch
-
+    }
 
-    const initialAsPath = (0, _isDynamic.isDynamicRoute)(page) && data.nextExport ? page : asPath;
-    exports.router = router = (0, _router.createRouter)(page, query, initialAsPath, {
+    exports.router = router = (0, _router.createRouter)(page, query, asPath, {
       initialProps: props,
       pageLoader,
       App,
Diff for index.html
@@ -6,19 +6,19 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/index.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/index.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <link rel="preload" href="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -26,40 +26,40 @@
         <div id="__next">Hello world 👋</div>
         <script id="__NEXT_DATA__" type="application/json"
         crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/","query":{},"buildId":"gRUeFYmB5z3IvP_60yty1"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/","query":{},"buildId":"jSSb4_8Ww5S8FpHUDDX9p"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/index.js"
+        <script async="" data-next-page="/" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/index.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/index.module.js"
+        <script async="" data-next-page="/" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/index.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/runtime/main-55b45fe5fab1b051a823.js"
+        <script src="/_next/static/runtime/main-26e9253859bbcb659328.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <script src="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         async="" crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.js"
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/b5da259654a9b6b59adf8dcdae35964911794302.155621535702fe040780.js"
+        <script src="/_next/static/chunks/c9ad98c952edf84ba2e42d115d25c51fd7c622ea.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>
Diff for link.html
@@ -6,19 +6,19 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/link.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/link.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <link rel="preload" href="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -29,18 +29,18 @@
             </div>
         </div>
         <script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/link","query":{},"buildId":"gRUeFYmB5z3IvP_60yty1"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/link","query":{},"buildId":"jSSb4_8Ww5S8FpHUDDX9p"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/link" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/link.js"
+        <script async="" data-next-page="/link" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/link.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/link" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/link.module.js"
+        <script async="" data-next-page="/link" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/link.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
@@ -50,19 +50,19 @@
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/b5da259654a9b6b59adf8dcdae35964911794302.155621535702fe040780.js"
+        <script src="/_next/static/chunks/c9ad98c952edf84ba2e42d115d25c51fd7c622ea.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/runtime/main-55b45fe5fab1b051a823.js"
+        <script src="/_next/static/runtime/main-26e9253859bbcb659328.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <script src="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>
Diff for withRouter.html
@@ -6,19 +6,19 @@
         <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
         />
         <meta name="next-head-count" content="2" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/withRouter.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/withRouter.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
         as="script" crossorigin="anonymous" />
         <link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <link rel="preload" href="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <link rel="preload" href="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         as="script" crossorigin="anonymous" />
-        <link rel="preload" href="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <link rel="preload" href="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         as="script" crossorigin="anonymous" />
     </head>
     
@@ -27,18 +27,18 @@
             <div>I use withRouter</div>
         </div>
         <script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">
-            {"dataManager":"[]","props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"gRUeFYmB5z3IvP_60yty1"}
+            {"dataManager":"[]","props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"jSSb4_8Ww5S8FpHUDDX9p"}
         </script>
         <script crossorigin="anonymous" nomodule="">
             !function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();
         </script>
-        <script async="" data-next-page="/withRouter" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/withRouter.js"
+        <script async="" data-next-page="/withRouter" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/withRouter.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/withRouter" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/withRouter.module.js"
+        <script async="" data-next-page="/withRouter" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/withRouter.module.js"
         crossorigin="anonymous" type="module"></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.js"
         crossorigin="anonymous" nomodule=""></script>
-        <script async="" data-next-page="/_app" src="/_next/static/gRUeFYmB5z3IvP_60yty1/pages/_app.module.js"
+        <script async="" data-next-page="/_app" src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/pages/_app.module.js"
         crossorigin="anonymous" type="module"></script>
         <script src="/_next/static/runtime/webpack-a470c2a25bcb4d5a8ec0.js"
         async="" crossorigin="anonymous" nomodule=""></script>
@@ -48,19 +48,19 @@
         async="" crossorigin="anonymous" nomodule=""></script>
         <script src="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/chunks/b5da259654a9b6b59adf8dcdae35964911794302.155621535702fe040780.js"
+        <script src="/_next/static/chunks/c9ad98c952edf84ba2e42d115d25c51fd7c622ea.155621535702fe040780.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.b3f63bf01308f3d17f5c.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.b3f63bf01308f3d17f5c.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/chunks/0f98677a7ba5c3c05d5e4640f9c783d44b41c5e0.85e4c18b9e4b400e5496.module.js"
+        <script src="/_next/static/chunks/52b3f2352500f338aa504b72584f60a0e6538f7e.85e4c18b9e4b400e5496.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/runtime/main-55b45fe5fab1b051a823.js"
+        <script src="/_next/static/runtime/main-26e9253859bbcb659328.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/runtime/main-0d26b819b58d326b70e7.module.js"
+        <script src="/_next/static/runtime/main-e3367c6cc0a826287f74.module.js"
         async="" crossorigin="anonymous" type="module"></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.js"
         async="" crossorigin="anonymous" nomodule=""></script>
-        <script src="/_next/static/gRUeFYmB5z3IvP_60yty1/_buildManifest.module.js"
+        <script src="/_next/static/jSSb4_8Ww5S8FpHUDDX9p/_buildManifest.module.js"
         async="" crossorigin="anonymous" type="module"></script>
     </body>

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
buildDuration 22.9s 22.6s -226ms
nodeModulesSize 42.4 MB 42.4 MB -825 B
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.js 18.3 kB 18.2 kB -46 B
main-HASH.js gzip 6.65 kB 6.64 kB -11 B
webpack-HASH.js 1.53 kB 1.53 kB
webpack-HASH.js gzip 746 B 746 B
3f9d15fa5822..2b8407376.js 21.9 kB N/A N/A
3f9d15fa5822..7376.js gzip 7.81 kB N/A N/A
ba95f42d9e6e..799a4e38e.js 43.1 kB N/A N/A
ba95f42d9e6e..e38e.js gzip 15.4 kB N/A N/A
framework.5b..dbaff70d3.js 125 kB 125 kB
framework.5b..70d3.js gzip 39.4 kB 39.4 kB
cca8112f765b..799a4e38e.js N/A 43.1 kB N/A
cca8112f765b..e38e.js gzip N/A 15.4 kB N/A
e28cd16b20ca..2b8407376.js N/A 21.9 kB N/A
e28cd16b20ca..7376.js gzip N/A 7.81 kB N/A
Overall change 210 kB 210 kB -46 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
main-HASH.module.js 16.6 kB 16.6 kB -50 B
main-HASH.module.js gzip 6.4 kB 6.38 kB -12 B
webpack-HASH.module.js 1.53 kB 1.53 kB
webpack-HASH..dule.js gzip 746 B 746 B
ba95f42d9e6e..f0.module.js 45.5 kB N/A N/A
ba95f42d9e6e..dule.js gzip 16.5 kB N/A N/A
framework.5b..d3.module.js 125 kB 125 kB
framework.5b..dule.js gzip 39.4 kB 39.4 kB
cca8112f765b..f0.module.js N/A 45.5 kB N/A
cca8112f765b..dule.js gzip N/A 16.5 kB N/A
Overall change 189 kB 189 kB -50 B
Client Pages
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.js 1.83 kB 1.83 kB
_app.js gzip 883 B 883 B
_error.js 12.1 kB 12.1 kB
_error.js gzip 4.74 kB 4.74 kB
hooks.js 12.7 kB 12.7 kB
hooks.js gzip 4.81 kB 4.81 kB
index.js 343 B 343 B
index.js gzip 237 B 237 B
link.js 8.14 kB 8.14 kB
link.js gzip 3.49 kB 3.49 kB
routerDirect.js 433 B 433 B
routerDirect.js gzip 296 B 296 B
withRouter.js 444 B 444 B
withRouter.js gzip 294 B 294 B
Overall change 36 kB 36 kB
Client Pages Modern
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_app.module.js 1.73 kB 1.73 kB
_app.module.js gzip 841 B 841 B
_error.module.js 23.3 kB 23.3 kB
_error.module.js gzip 8.6 kB 8.6 kB
hooks.module.js 1.55 kB 1.55 kB
hooks.module.js gzip 804 B 804 B
index.module.js 319 B 319 B
index.module.js gzip 238 B 238 B
link.module.js 8.52 kB 8.52 kB
link.module.js gzip 3.67 kB 3.67 kB
routerDirect.module.js 419 B 419 B
routerDirect..dule.js gzip 294 B 294 B
withRouter.module.js 429 B 429 B
withRouter.m..dule.js gzip 293 B 293 B
Overall change 36.2 kB 36.2 kB
Client Build Manifests
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_buildManifest.js 81 B 81 B
_buildManifest.js gzip 61 B 61 B
_buildManifest.module.js 81 B 81 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 162 B 162 B
Serverless bundles
zeit/next.js canary WestonThayer/next.js example-with-sentry-simple-update Change
_error.js 247 kB 247 kB
_error.js gzip 66.2 kB 66.2 kB ���️ +9 B
hooks.html 3.86 kB 3.86 kB
hooks.html gzip 981 B 984 B ⚠️ +3 B
index.js 248 kB 248 kB
index.js gzip 66.5 kB 66.4 kB -41 B
link.js 255 kB 255 kB
link.js gzip 68.6 kB 68.5 kB -74 B
routerDirect.js 249 kB 249 kB
routerDirect.js gzip 66.5 kB 66.6 kB ⚠️ +53 B
withRouter.js 249 kB 249 kB
withRouter.js gzip 66.6 kB 66.6 kB -19 B
Overall change 1.25 MB 1.25 MB
Copy link
Contributor

@huv1k huv1k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx @WestonThayer, for your PR. We are going to merge it until we have a proper solution for logging errors. Like I said before we are going to introduce new RFC for error reporting, stay tunned.

@timneutkens timneutkens merged commit dc28e5b into vercel:canary Sep 17, 2019
mcansh added a commit to mcansh/blog that referenced this pull request Sep 17, 2019
vercel/next.js#8684
Signed-off-by: Logan McAnsh <logan@mcan.sh>
@WestonThayer WestonThayer deleted the example-with-sentry-simple-update branch September 24, 2019 15:31
@rwieruch
Copy link
Contributor

Any news for the improved error reporting @huv1k Otherwise I would go with this sentry example for now. Thanks for all your work @WestonThayer 🚀

@WestonThayer
Copy link
Contributor Author

@huv1k just wanted to check back on that RFC. I still don't have a good solution for #8685

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
6 participants