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

Add proper error when conflicting paths are detected #20918

Merged
merged 5 commits into from Jan 11, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jan 8, 2021

This helps catch conflicting paths returned from getStaticPaths with a friendly error

Preview of error Screen Shot 2021-01-08 at 5 03 04 PM Screen Shot 2021-01-08 at 5 03 41 PM

Closes: #19527

@ijjk
Copy link
Member Author

ijjk commented Jan 8, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 8.7s 8.8s ⚠️ +61ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +7.47 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
/ failed reqs 0 0
/ total time (seconds) 1.722 1.708 -0.01
/ avg req/sec 1451.44 1463.69 +12.25
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.106 1.123 ⚠️ +0.02
/error-in-render avg req/sec 2261.15 2226.35 ⚠️ -34.8
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-dba4ec1..27c0.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
index.html gzip 614 B 614 B
link.html gzip 619 B 619 B
withRouter.html gzip 606 B 606 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 10.3s 10.4s ⚠️ +55ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +7.47 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-dba4ec1..27c0.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 999a815

@ijjk ijjk marked this pull request as ready for review Jan 9, 2021
@ijjk ijjk requested review from lfades, Timer and timneutkens as code owners Jan 9, 2021
timneutkens
timneutkens previously approved these changes Jan 11, 2021
…rror

# Conflicts:
#	packages/next/build/index.ts
#	packages/next/build/utils.ts
@ijjk
Copy link
Member Author

ijjk commented Jan 11, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 9.1s 9.2s ⚠️ +102ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
/ failed reqs 0 0
/ total time (seconds) 1.781 1.803 ⚠️ +0.02
/ avg req/sec 1403.36 1386.91 ⚠️ -16.45
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.185 1.169 -0.02
/error-in-render avg req/sec 2109.52 2138.42 +28.9
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-9769710..cf61.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
index.html gzip 615 B 615 B
link.html gzip 620 B 620 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 11s 10.8s -170ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-9769710..cf61.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 38a5fb9

Timer
Timer approved these changes Jan 11, 2021
@ijjk
Copy link
Member Author

ijjk commented Jan 11, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 10.4s 10.5s ⚠️ +48ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
/ failed reqs 0 0
/ total time (seconds) 2.104 2.051 -0.05
/ avg req/sec 1188.18 1218.65 +30.47
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.41 1.338 -0.07
/error-in-render avg req/sec 1772.97 1868.72 +95.75
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-e66dcae..6635.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
index.html gzip 615 B 615 B
link.html gzip 619 B 619 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 12.7s 12.5s -198ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-e66dcae..6635.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: c9b9592

@ijjk
Copy link
Member Author

ijjk commented Jan 11, 2021

Failing test suites

Commit: c9b9592

test/integration/image-component/custom-resolver/test/index.test.js

  • Custom Resolver Tests > Client-side Custom Loader Tests > Should use a custom resolver for image URL
  • Custom Resolver Tests > Client-side Custom Loader Tests > should add a srcset based on the custom resolver
  • Custom Resolver Tests > Client-side Custom Loader Tests > should support the unoptimized attribute
Expand output

● Custom Resolver Tests › Client-side Custom Loader Tests › Should use a custom resolver for image URL

StaleElementReferenceError: stale element reference: element is not attached to the page document
  (Session info: headless chrome=87.0.4280.88)

  14 | function runTests() {
  15 |   it('Should use a custom resolver for image URL', async () => {
> 16 |     expect(await browser.elementById('basic-image').getAttribute('src')).toBe(
     |            ^
  17 |       'https://customresolver.com/foo.jpg?w~~1024,q~~60'
  18 |     )
  19 |   })

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:565:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:491:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.<anonymous> (integration/image-component/custom-resolver/test/index.test.js:16:12)

● Custom Resolver Tests › Client-side Custom Loader Tests › should add a srcset based on the custom resolver

StaleElementReferenceError: stale element reference: element is not attached to the page document
  (Session info: headless chrome=87.0.4280.88)

  14 | function runTests() {
  15 |   it('Should use a custom resolver for image URL', async () => {
> 16 |     expect(await browser.elementById('basic-image').getAttribute('src')).toBe(
     |            ^
  17 |       'https://customresolver.com/foo.jpg?w~~1024,q~~60'
  18 |     )
  19 |   })

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:565:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:491:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.<anonymous> (integration/image-component/custom-resolver/test/index.test.js:16:12)

● Custom Resolver Tests › Client-side Custom Loader Tests › should support the unoptimized attribute

StaleElementReferenceError: stale element reference: element is not attached to the page document
  (Session info: headless chrome=87.0.4280.88)

  14 | function runTests() {
  15 |   it('Should use a custom resolver for image URL', async () => {
> 16 |     expect(await browser.elementById('basic-image').getAttribute('src')).toBe(
     |            ^
  17 |       'https://customresolver.com/foo.jpg?w~~1024,q~~60'
  18 |     )
  19 |   })

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:565:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:491:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.<anonymous> (integration/image-component/custom-resolver/test/index.test.js:16:12)

@ijjk ijjk mentioned this pull request Jan 11, 2021
@ijjk
Copy link
Member Author

ijjk commented Jan 11, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 12.1s 12.2s ⚠️ +15ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
/ failed reqs 0 0
/ total time (seconds) 2.454 2.496 ⚠️ +0.04
/ avg req/sec 1018.79 1001.42 ⚠️ -17.37
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.717 1.766 ⚠️ +0.05
/error-in-render avg req/sec 1456.22 1415.71 ⚠️ -40.51
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-e66dcae..6635.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
index.html gzip 615 B 615 B
link.html gzip 619 B 619 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
buildDuration 14.6s 14.4s -234ms
nodeModulesSize 80.8 MB 80.9 MB ⚠️ +7.49 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
677f882d2ed8..b025.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-e66dcae..6635.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary ijjk/next.js conflicting-ssg-error Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 4fe1cbd

@kodiakhq kodiakhq bot merged commit 9caca27 into vercel:canary Jan 11, 2021
25 of 27 checks passed
@ijjk ijjk deleted the conflicting-ssg-error branch Jan 11, 2021
kodiakhq bot pushed a commit that referenced this issue Jan 13, 2021
This ensures the page has transitioned fully before testing which should resolve the random failure seen in a couple of runs. 
 
x-ref: #20918 (comment)
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants