Skip to content

hmr error improvements - #30616

Merged
timneutkens merged 8 commits into
canaryfrom
bugfix/errors
Jan 6, 2023
Merged

timneutkens merged 8 commits into
canaryfrom
bugfix/errors

Conversation

@sokra

@sokra sokra commented Oct 29, 2021

Copy link
Copy Markdown
Member
  • use HMR for HMR test (due to unnamed export default this always did a full refresh)
  • show import trace on client-side too
  • hide next.js internal loaders in parse errors
  • show import trace in non-verbose errors too

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Oct 29, 2021
use HMR for HMR test
show import trace on client-side too
hide next.js internal loaders in parse errors
show import trace in non-verbose errors too
@ijjk

ijjk commented Oct 29, 2021 •

Copy link
Copy Markdown
Member

Stats from current PR

Default Build
General Overall increase ⚠️
vercel/next.js canary vercel/next.js bugfix/errors Change
buildDuration 37.6s 37s -585ms
buildDurationCached 15.6s 10.6s -5s
nodeModulesSize 95.2 MB 95.2 MB ✓
nextStartRea..uration (ms) 283ms 285ms ⚠️ +2ms
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary vercel/next.js bugfix/errors Change
152-HASH.js gzip 64.5 kB 64.5 kB ✓
53.HASH.js gzip 182 B 182 B ✓
main-app-HASH.js gzip 204 B 205 B ⚠️ +1 B
main-HASH.js gzip 79.2 kB 79.2 kB ✓
webpack-HASH.js gzip 1.7 kB 1.7 kB ✓
Overall change 146 kB 146 kB ⚠️ +1 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js bugfix/errors Change
polyfills-HASH.js gzip 31 kB 31 kB ✓
Overall change 31 kB 31 kB ✓
Client Pages
vercel/next.js canary vercel/next.js bugfix/errors Change
_app-HASH.js gzip 192 B 192 B ✓
_error-HASH.js gzip 179 B 179 B ✓
amp-HASH.js gzip 484 B 484 B ✓
css-HASH.js gzip 804 B 804 B ✓
dynamic-HASH.js gzip 2.27 kB 2.27 kB ✓
edge-ssr-HASH.js gzip 255 B 255 B ✓
head-HASH.js gzip 827 B 827 B ✓
hooks-HASH.js gzip 848 B 848 B ✓
image-HASH.js gzip 4.3 kB 4.3 kB ✓
index-HASH.js gzip 252 B 252 B ✓
link-HASH.js gzip 2.69 kB 2.69 kB ✓
routerDirect..HASH.js gzip 782 B 782 B ✓
script-HASH.js gzip 857 B 857 B ✓
withRouter-HASH.js gzip 781 B 781 B ✓
85e02e95b279..7e3.css gzip 107 B 107 B ✓
Overall change 15.6 kB 15.6 kB ✓
Client Build Manifests
vercel/next.js canary vercel/next.js bugfix/errors Change
_buildManifest.js gzip 482 B 482 B ✓
Overall change 482 B 482 B ✓
Rendered Page Sizes
vercel/next.js canary vercel/next.js bugfix/errors Change
index.html gzip 490 B 490 B ✓
link.html gzip 506 B 506 B ✓
withRouter.html gzip 485 B 485 B ✓
Overall change 1.48 kB 1.48 kB ✓
Edge SSR bundle Size
vercel/next.js canary vercel/next.js bugfix/errors Change
edge-ssr.js gzip 110 kB 110 kB ✓
page.js gzip 98.4 kB 98.4 kB ✓
Overall change 209 kB 209 kB ✓
Middleware size
vercel/next.js canary vercel/next.js bugfix/errors Change
middleware-b..fest.js gzip 585 B 585 B ✓
middleware-r..fest.js gzip 145 B 145 B ✓
middleware.js gzip 27.1 kB 27.1 kB ✓
edge-runtime..pack.js gzip 1.83 kB 1.83 kB ✓
Overall change 29.7 kB 29.7 kB ✓
Commit: 5febd9c

@ijjk

ijjk commented Oct 29, 2021

Copy link
Copy Markdown
Member

Failing test suites

Commit: eeff5ee

test/development/basic/hmr.test.ts

  • basic HMR > Error Recovery > should recover after loader parse error in an imported file
Expand output

● basic HMR › Error Recovery › should recover after loader parse error in an imported file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `basic HMR Error Recovery should recover after loader parse error in an imported file 2`

- Snapshot  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  ./components/parse-error.js
  Error: error: Unexpected token `}`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier
-
+  
    |
  3 | }}}
    | ^

  Caused by:

  754 |
  755 |         expect(await hasRedbox(browser)).toBe(true)
> 756 |         expect(await getRedboxHeader(browser)).toMatchInlineSnapshot(`
      |                                                ^
  757 |           " 1 of 1 unhandled error
  758 |           Unhandled Runtime Error
  759 |

  at Object.<anonymous> (development/basic/hmr.test.ts:756:48)

@ijjk
ijjk force-pushed the canary branch 3 times, most recently from df8579c to 47e5ebe Compare October 25, 2022 16:15
@ijjk
ijjk force-pushed the canary branch 2 times, most recently from e078ebe to 6b863fe Compare December 2, 2022 05:49
@ijjk ijjk added create-next-app Related to our CLI tool for quickly starting a new Next.js application. area: documentation examples Issue was opened via the examples template. labels Dec 13, 2022
@hanneslund
hanneslund marked this pull request as ready for review January 4, 2023 16:04
@timneutkens

Copy link
Copy Markdown
Contributor

Amazing work @sokra @hanneslund 👏

@timneutkens
timneutkens merged commit 3b91ca9 into canary Jan 6, 2023
@timneutkens
timneutkens deleted the bugfix/errors branch January 6, 2023 19:35
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

create-next-app Related to our CLI tool for quickly starting a new Next.js application. created-by: Next.js team PRs by the Next.js team. examples Issue was opened via the examples template. type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants