Skip to content

Conversation

@devknoll
Copy link
Contributor

WARNING: DO NOT USE THIS

I'm kicking off development on concurrent features. This is highly experimental and unstable. It will change. Please do NOT use it in your apps.

To begin with, this PR adds a highly experimental concurrentFeatures: boolean configuration to gate API changes. Additionally, it adds the start of one such API change: errors + tests to ensure pages/_document is a functional component, rather than a class. That's because it's eventually going to become a React Server Component.

More coming.

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Failing test suites

Commit: cc32469

test/integration/amp-export-validation/test/index.test.js

  • AMP Validation on Export > should have shown errors during build
  • AMP Validation on Export > should export AMP pages
  • AMP Validation on Export > shows AMP warning without throwing error
  • AMP Validation on Export > throws error on AMP error
  • AMP Validation on Export > shows warning and error when throwing error
Expand output

● AMP Validation on Export › should have shown errors during build

expect(received).toMatch(expected)

Expected pattern: /error.*The parent tag of tag 'img' is 'div', but it can only be 'i-amphtml-sizer-intrinsic'\./
Received string:  "info  - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types...
info  - Creating an optimized production build...
info  - Compiled successfully
info  - Collecting page data...
info  - Generating static pages (0/8)
info  - Generating static pages (2/8)
info  - Generating static pages (4/8)
info  - Generating static pages (6/8)
info  - Generating static pages (8/8)
warn  - Detected next.config.js, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration·
Error occurred prerendering page \"/cat\". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /cat

  19 | // TODO: remove this workaround when https://bugs.webkit.org/show_bug.cgi?id=187726 is fixed.
  20 | renderOpts.devOnlyCacheBusterQueryString=renderOpts.dev?renderOpts.devOnlyCacheBusterQueryString||`?ts=${Date.now()}`:'';// don't modify original query object
> 21 | query=Object.assign({},query);const{err,dev=false,ampPath='',App,Document,pageConfig={},Component,buildManifest,fontManifest,reactLoadableManifest,ErrorDebug,getStaticProps,getStaticPaths,getServerSideProps,isDataReq,params,previewProps,basePath,devOnlyCacheBusterQueryString}=renderOpts;const getFontDefinition=url=>{if(fontManifest){return(0,_fontUtils.getFontDefinitionFromManifest)(url,fontManifest);}return'';};const callMiddleware=async(method,args,props=false)=>{let results=props?{}:[];if(Document[`${method}Middleware`]){let middlewareFunc=await Document[`${method}Middleware`];middlewareFunc=middlewareFunc.default||middlewareFunc;const curResults=await middlewareFunc(...args);if(props){for(const result of curResults){results={...results,...result};}}else{results=curResults;}}return results;};const headTags=(...args)=>callMiddleware('headTags',args);const isFallback=!!query.__nextFallback;delete query.__nextFallback;delete query.__nextLocale;delete query.__nextDefaultLocale;const isSSG=!!getStaticProps;const isBuildTimeSSG=isSSG&&renderOpts.nextExport;const defaultAppGetInitialProps=App.getInitialProps===App.origGetInitialProps;const hasPageGetInitialProps=!!Component.getInitialProps;const pageIsDynamic=(0,_isDynamic.isDynamicRoute)(pathname);const isAutoExport=!hasPageGetInitialProps&&defaultAppGetInitialProps&&!isSSG&&!getServerSideProps;if(process.env.NEXT_CONCURRENT_FEATURES&&typeof Document!=='function'||Document.prototype){throw new Error(_constants.CUSTOM_DOCUMENT_RSC_ERROR+` ${pathname}`);}for(const methodName of['getStaticProps','getServerSideProps','getStaticPaths']){if(Component[methodName]){throw new Error(`page ${pathname} ${methodName} ${_constants.GSSP_COMPONENT_MEMBER_ERROR}`);}}if(hasPageGetInitialProps&&isSSG){throw new Error(_constants.SSG_GET_INITIAL_PROPS_CONFLICT+` ${pathname}`);}if(hasPageGetInitialProps&&getServerSideProps){throw new Error(_constants.SERVER_PROPS_GET_INIT_PROPS_CONFLICT+` ${pathname}`);}if(getServerSideProps&&isSSG){throw new Error(_constants.SERVER_PROPS_SSG_CONFLICT+` ${pathname}`);}if(getStaticPaths&&!pageIsDynamic){throw new Error(`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.`+`\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`);}if(!!getStaticPaths&&!isSSG){throw new Error(`getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`);}if(isSSG&&pageIsDynamic&&!getStaticPaths){throw new Error(`getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.`+`\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`);}let asPath=renderOpts.resolvedAsPath||req.url;if(dev){const{isValidElementType}=require('react-is');if(!isValidElementType(Component)){throw new Error(`The default export is not a React Component in page: "${pathname}"`);}if(!isValidElementType(App)){throw new Error(`The default export is not a React Component in page: "/_app"`);}if(!isValidElementType(Document)){throw new Error(`The default export is not a React Component in page: "/_document"`);}if(isAutoExport||isFallback){// remove query values except ones that will be set during export
     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ^
  22 | query={...(query.amp?{amp:query.amp}:{})};asPath=`${pathname}${// ensure trailing slash is present for non-dynamic auto-export pages
  23 | req.url.endsWith('/')&&pathname!=='/'&&!pageIsDynamic?'/':''}`;req.url=pathname;}if(pathname==='/404'&&(hasPageGetInitialProps||getServerSideProps)){throw new Error(`\`pages/404\` ${_constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`);}if(_constants2.STATIC_STATUS_PAGES.includes(pathname)&&(hasPageGetInitialProps||getServerSideProps)){throw new Error(`\`pages${pathname}\` ${_constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`);}}await _loadable.default.preloadAll();// Make sure all dynamic imports are loaded
  24 | let isPreview;let previewData;if((isSSG||getServerSideProps)&&!isFallback){// Reads of this are cached on the `req` object, so this should resolve

  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/dog-cat\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /dog-cat
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/dog\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /dog
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/first\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /first
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/second\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /second
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/third\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /third
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/404\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /_error
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  Error occurred prerendering page \"/500\". Read more: https://nextjs.org/docs/messages/prerender-error
  Error: Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc /_error
  at renderToHTML (../packages/next/dist/next-server/server/render.js:21:1462)
  at ../packages/next/dist/export/worker.js:26:12
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)·
  > Build error occurred
  Error: Export encountered errors on following paths:
  	/404
  	/500
  	/cat
  	/dog
  	/dog-cat
  	/first
  	/second
  	/third
  at ../packages/next/dist/export/index.js:31:1106
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)
  at ../async /home/runner/work/next.js/next.js/packages/next/dist/build/index.js:43:49
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)
  at ../async /home/runner/work/next.js/next.js/packages/next/dist/build/index.js:25:1475
  at async Span.traceAsyncFn (../packages/next/dist/telemetry/trace/trace.js:6:584)
  "
  at Object.<anonymous> (integration/amp-export-validation/test/index.test.js:27:25)

● AMP Validation on Export › should export AMP pages

ENOENT: no such file or directory, open '/home/runner/work/next.js/next.js/test/integration/amp-export-validation/out/first.html'

● AMP Validation on Export › shows AMP warning without throwing error

expect(received).toMatch(expected)

Expected pattern: /error.*The mandatory attribute 'height' is missing in tag 'amp-video'\./
Received string:  "info  - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
info  - using build directory: /home/runner/work/next.js/next.js/test/integration/amp-export-validation/.next
info  - Copying \"static build\" directory
info  - Launching 1 workers
info  - Exporting (0/3)
info  - Exporting (3/3)
"

  55 |         stderr: true,
  56 |       })
> 57 |       expect(stdout).toMatch(
     |                      ^
  58 |         /error.*The mandatory attribute 'height' is missing in tag 'amp-video'\./
  59 |       )
  60 |       await expect(access(join(outDir, 'cat.html'))).resolves.toBe(undefined)

  at Object.<anonymous> (integration/amp-export-validation/test/index.test.js:57:22)

● AMP Validation on Export › throws error on AMP error

expect(received).toMatch(expected)

Expected pattern: /error.*The parent tag of tag 'img' is 'div', but it can only be 'i-amphtml-sizer-intrinsic'\./
Received string:  "info  - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
info  - using build directory: /home/runner/work/next.js/next.js/test/integration/amp-export-validation/.next
info  - Copying \"static build\" directory
info  - Launching 1 workers
info  - Exporting (0/3)
info  - Exporting (3/3)
"

  82 |         stderr: true,
  83 |       })
> 84 |       expect(stdout).toMatch(
     |                      ^
  85 |         /error.*The parent tag of tag 'img' is 'div', but it can only be 'i-amphtml-sizer-intrinsic'\./
  86 |       )
  87 |       await expect(access(join(outDir, 'dog.html'))).resolves.toBe(undefined)

  at Object.<anonymous> (integration/amp-export-validation/test/index.test.js:84:22)

● AMP Validation on Export › shows warning and error when throwing error

expect(received).toMatch(expected)

Expected pattern: /error.*The parent tag of tag 'img' is 'div', but it can only be 'i-amphtml-sizer-intrinsic'\./
Received string:  "info  - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
info  - using build directory: /home/runner/work/next.js/next.js/test/integration/amp-export-validation/.next
info  - Copying \"static build\" directory
info  - Launching 1 workers
info  - Exporting (0/3)
info  - Exporting (3/3)
"

  109 |         stderr: true,
  110 |       })
> 111 |       expect(stdout).toMatch(
      |                      ^
  112 |         /error.*The parent tag of tag 'img' is 'div', but it can only be 'i-amphtml-sizer-intrinsic'\./
  113 |       )
  114 |       await expect(access(join(outDir, 'dog-cat.html'))).resolves.toBe(

  at Object.<anonymous> (integration/amp-export-validation/test/index.test.js:111:22)

test/integration/auto-export-serverless/test/index.test.js

  • Auto Export Serverless > Refreshes query on mount
Expand output

● Auto Export Serverless › Refreshes query on mount

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

test/integration/conflicting-public-file-page/test/index.test.js

  • Errors on conflict between public file and page file > Throws error during development
Expand output

● Errors on conflict between public file and page file › Throws error during development

expect(received).toMatch(expected)

Expected pattern: /A conflicting public file and page file was found for path/
Received string:  "Internal Server Error"

  21 |     for (const conflict of conflicts) {
  22 |       const html = await renderViaHTTP(appPort, conflict)
> 23 |       expect(html).toMatch(
     |                    ^
  24 |         /A conflicting public file and page file was found for path/
  25 |       )
  26 |     }

  at Object.<anonymous> (integration/conflicting-public-file-page/test/index.test.js:23:20)

test/integration/amphtml-custom-optimizer/test/index.test.js

  • AMP Custom Optimizer > should build and start for static page
  • AMP Custom Optimizer > should build and start for dynamic page
Expand output

● AMP Custom Optimizer › should build and start for static page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● AMP Custom Optimizer › should build and start for dynamic page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

test/integration/absolute-assetprefix/test/index.test.js

  • absolute assetPrefix with path prefix > should not fetch static data from a CDN
  • absolute assetPrefix with path prefix > should fetch from cache correctly
  • absolute assetPrefix with path prefix > should work with getStaticPaths prerendered
  • absolute assetPrefix with path prefix > should work with getStaticPaths fallback
  • absolute assetPrefix with path prefix > should work with getServerSideProps
Expand output

● absolute assetPrefix with path prefix › should not fetch static data from a CDN

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● absolute assetPrefix with path prefix › should fetch from cache correctly

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● absolute assetPrefix with path prefix › should work with getStaticPaths prerendered

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● absolute assetPrefix with path prefix › should work with getStaticPaths fallback

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● absolute assetPrefix with path prefix › should work with getServerSideProps

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● Test suite failed to run

TypeError: Cannot read property 'pid' of undefined

  292 | export async function killApp(instance) {
  293 |   await new Promise((resolve, reject) => {
> 294 |     treeKill(instance.pid, (err) => {
      |                       ^
  295 |       if (err) {
  296 |         if (
  297 |           process.platform === 'win32' &&

  at lib/next-test-utils.js:294:23
  at killApp (lib/next-test-utils.js:293:9)
  at integration/absolute-assetprefix/test/index.test.js:65:18

test/integration/api-support/test/index.test.js

  • API routes > Server support > should render page
  • API routes > Server support > should return 404 for undefined path
  • API routes > Server support > should not conflict with /api routes
  • API routes > Server support > should set cors headers when adding cors middleware
  • API routes > Server support > should work with index api
  • API routes > Server support > should return custom error
  • API routes > Server support > should throw Internal Server Error
  • API routes > Server support > should throw Internal Server Error (async)
  • API routes > Server support > should parse JSON body
  • API routes > Server support > should special-case empty JSON body
  • API routes > Server support > should support boolean for JSON in api page
  • API routes > Server support > should support undefined response body
  • API routes > Server support > should return error with invalid JSON
  • API routes > Server support > should return error exceeded body limit
  • API routes > Server support > should parse bigger body then 1mb
  • API routes > Server support > should support etag spec
  • API routes > Server support > should parse urlencoded body
  • API routes > Server support > should parse body in handler
  • API routes > Server support > should parse body with config
  • API routes > Server support > should show friendly error for invalid redirect
  • API routes > Server support > should show friendly error in case of passing null as first argument redirect
  • API routes > Server support > should redirect with status code 307
  • API routes > Server support > should redirect to login
  • API routes > Server support > should redirect with status code 301
  • API routes > Server support > should return empty query object
  • API routes > Server support > should parse query correctly
  • API routes > Server support > should return empty cookies object
  • API routes > Server support > should return cookies object
  • API routes > Server support > should return 200 on POST on pages
  • API routes > Server support > should return JSON on post on API
  • API routes > Server support > should return data on dynamic route
  • API routes > Server support > should work with dynamic params and search string
  • API routes > Server support > should work with dynamic params and search string like lambda
  • API routes > Server support > should prioritize a non-dynamic page
  • API routes > Server support > should return data on dynamic nested route
  • API routes > Server support > should 404 on optional dynamic api page
  • API routes > Server support > should return data on dynamic optional nested route
  • API routes > Server support > should work with child_process correctly
  • API routes > Server support > should show warning with next export
  • API routes > Server support > should build api routes
  • API routes > Serverless support > should render page
  • API routes > Serverless support > should return 404 for undefined path
  • API routes > Serverless support > should not conflict with /api routes
  • API routes > Serverless support > should set cors headers when adding cors middleware
  • API routes > Serverless support > should work with index api
  • API routes > Serverless support > should return custom error
  • API routes > Serverless support > should throw Internal Server Error
  • API routes > Serverless support > should throw Internal Server Error (async)
  • API routes > Serverless support > should parse JSON body
  • API routes > Serverless support > should special-case empty JSON body
  • API routes > Serverless support > should support boolean for JSON in api page
  • API routes > Serverless support > should support undefined response body
  • API routes > Serverless support > should return error with invalid JSON
  • API routes > Serverless support > should return error exceeded body limit
  • API routes > Serverless support > should parse bigger body then 1mb
  • API routes > Serverless support > should support etag spec
  • API routes > Serverless support > should parse urlencoded body
  • API routes > Serverless support > should parse body in handler
  • API routes > Serverless support > should parse body with config
  • API routes > Serverless support > should show friendly error for invalid redirect
  • API routes > Serverless support > should show friendly error in case of passing null as first argument redirect
  • API routes > Serverless support > should redirect with status code 307
  • API routes > Serverless support > should redirect to login
  • API routes > Serverless support > should redirect with status code 301
  • API routes > Serverless support > should return empty query object
  • API routes > Serverless support > should parse query correctly
  • API routes > Serverless support > should return empty cookies object
  • API routes > Serverless support > should return cookies object
  • API routes > Serverless support > should return 200 on POST on pages
  • API routes > Serverless support > should return JSON on post on API
  • API routes > Serverless support > should return data on dynamic route
  • API routes > Serverless support > should work with dynamic params and search string
  • API routes > Serverless support > should work with dynamic params and search string like lambda
  • API routes > Serverless support > should prioritize a non-dynamic page
  • API routes > Serverless support > should return data on dynamic nested route
  • API routes > Serverless support > should 404 on optional dynamic api page
  • API routes > Serverless support > should return data on dynamic optional nested route
  • API routes > Serverless support > should work with child_process correctly
  • API routes > Serverless support > should show warning with next export
  • API routes > Serverless support > should build api routes
  • API routes > dev support > should render page
  • API routes > dev support > should return 404 for undefined path
  • API routes > dev support > should return 200 on POST on pages
  • API routes > dev support > should 404 on optional dynamic api page
Expand output

● API routes › dev support › should render page

expect(received).toMatch(expected)

Expected pattern: /API - support/
Received string:  "Internal Server Error"

  29 |   it('should render page', async () => {
  30 |     const html = await renderViaHTTP(appPort, '/')
> 31 |     expect(html).toMatch(/API - support/)
     |                  ^
  32 |   })
  33 |
  34 |   it('should return 404 for undefined path', async () => {

  at Object.<anonymous> (integration/api-support/test/index.test.js:31:18)

● API routes › dev support › should return 404 for undefined path

expect(received).toEqual(expected) // deep equality

Expected: 404
Received: 500

  39 |       {}
  40 |     )
> 41 |     expect(status).toEqual(404)
     |                    ^
  42 |   })
  43 |
  44 |   it('should not conflict with /api routes', async () => {

  at Object.<anonymous> (integration/api-support/test/index.test.js:41:20)

● API routes › dev support › should return 200 on POST on pages

expect(received).toEqual(expected) // deep equality

Expected: 200
Received: 500

  318 |     })
  319 |
> 320 |     expect(res.status).toEqual(200)
      |                        ^
  321 |   })
  322 |
  323 |   it('should return JSON on post on API', async () => {

  at Object.<anonymous> (integration/api-support/test/index.test.js:320:24)

● API routes › dev support › should 404 on optional dynamic api page

expect(received).toBe(expected) // Object.is equality

Expected: 404
Received: 500

  380 |     const res = await fetchViaHTTP(appPort, '/api/blog/543/comment', null, {})
  381 |
> 382 |     expect(res.status).toBe(404)
      |                        ^
  383 |   })
  384 |
  385 |   it('should return data on dynamic optional nested route', async () => {

  at Object.<anonymous> (integration/api-support/test/index.test.js:382:24)

● API routes › Server support › should render page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return 404 for undefined path

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should not conflict with /api routes

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should set cors headers when adding cors middleware

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should work with index api

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return custom error

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should throw Internal Server Error

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should throw Internal Server Error (async)

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse JSON body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should special-case empty JSON body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should support boolean for JSON in api page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should support undefined response body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return error with invalid JSON

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return error exceeded body limit

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse bigger body then 1mb

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should support etag spec

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse urlencoded body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse body in handler

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse body with config

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should show friendly error for invalid redirect

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should show friendly error in case of passing null as first argument redirect

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should redirect with status code 307

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should redirect to login

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should redirect with status code 301

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return empty query object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should parse query correctly

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return empty cookies object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return cookies object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return 200 on POST on pages

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return JSON on post on API

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return data on dynamic route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should work with dynamic params and search string

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should work with dynamic params and search string like lambda

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should prioritize a non-dynamic page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return data on dynamic nested route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should 404 on optional dynamic api page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should return data on dynamic optional nested route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should work with child_process correctly

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should show warning with next export

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Server support › should build api routes

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should render page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return 404 for undefined path

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should not conflict with /api routes

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should set cors headers when adding cors middleware

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should work with index api

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return custom error

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should throw Internal Server Error

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should throw Internal Server Error (async)

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse JSON body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should special-case empty JSON body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should support boolean for JSON in api page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should support undefined response body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return error with invalid JSON

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return error exceeded body limit

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse bigger body then 1mb

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should support etag spec

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse urlencoded body

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse body in handler

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse body with config

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should show friendly error for invalid redirect

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should show friendly error in case of passing null as first argument redirect

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should redirect with status code 307

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should redirect to login

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should redirect with status code 301

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return empty query object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should parse query correctly

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return empty cookies object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return cookies object

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return 200 on POST on pages

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return JSON on post on API

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return data on dynamic route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should work with dynamic params and search string

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should work with dynamic params and search string like lambda

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should prioritize a non-dynamic page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return data on dynamic nested route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should 404 on optional dynamic api page

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should return data on dynamic optional nested route

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should work with child_process correctly

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should show warning with next export

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

● API routes › Serverless support › should build api routes

command failed with code 1

  147 |         code !== 0
  148 |       ) {
> 149 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  150 |       }
  151 |
  152 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:149:23)

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Failing test suites

Commit: cd365c0

test/integration/concurrent-document-component-error/test/index.test.js

  • Concurrent Document Component Errors > development mode > errors when document is a class component
Expand output

● Concurrent Document Component Errors › development mode › errors when document is a class component

expect(received).toContain(expected) // indexOf

Expected substring: "Custom Document must be a functional Server Component. See more info here: https://nextjs.org/docs/messages/custom-document-rsc"
Received string:    "undefinedready - started server on 0.0.0.0:42999, url: http://localhost:42999
info  - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
warn  - You have enabled experimental feature(s).
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.·
event - compiled successfully
event - build page: /next/dist/pages/_error
wait  - compiling...
event - compiled successfully
"

  37 |
  38 |     it('errors when document is a class component', () => {
> 39 |       expect(output).toContain(CUSTOM_DOCUMENT_RSC_ERROR)
     |                      ^
  40 |     })
  41 |   })
  42 | })

  at Object.<anonymous> (integration/concurrent-document-component-error/test/index.test.js:39:22)

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 14.5s 14.7s ⚠️ +177ms
buildDurationCached 5s 4.6s -380ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +4.62 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.464 2.524 ⚠️ +0.06
/ avg req/sec 1014.54 990.37 ⚠️ -24.17
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.264 1.375 ⚠️ +0.11
/error-in-render avg req/sec 1977.1 1817.94 ⚠️ -159.16
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 608 B 608 B
link.html gzip 615 B 615 B
withRouter.html gzip 605 B 605 B
Overall change 1.83 kB 1.83 kB

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 17.7s 18s ⚠️ +241ms
buildDurationCached 6.8s 6.8s ⚠️ +89ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +4.62 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_error.js 1.35 MB 1.35 MB ⚠️ +419 B
404.html 2.76 kB 2.76 kB
500.html 2.75 kB 2.75 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.96 kB 1.96 kB
css.html 2.13 kB 2.13 kB
hooks.html 2.01 kB 2.01 kB
index.js 1.35 MB 1.35 MB ⚠️ +419 B
link.js 1.4 MB 1.4 MB ⚠️ +415 B
routerDirect.js 1.4 MB 1.4 MB ⚠️ +419 B
withRouter.js 1.4 MB 1.4 MB ⚠️ +419 B
Overall change 6.91 MB 6.91 MB ⚠️ +2.09 kB

Webpack 4 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 12.7s 12.5s -285ms
buildDurationCached 5.2s 5.1s -86ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +4.62 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.386 2.546 ⚠️ +0.16
/ avg req/sec 1047.78 981.92 ⚠️ -65.86
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.272 1.351 ⚠️ +0.08
/error-in-render avg req/sec 1966.07 1850.18 ⚠️ -115.89
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.19 kB 7.19 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.2 kB 60.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.28 kB 1.28 kB
_error-HASH.js gzip 3.71 kB 3.71 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 339 B 339 B
hooks-HASH.js gzip 887 B 887 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 303 B 303 B
withRouter-HASH.js gzip 302 B 302 B
21c68fa65a48..217.css gzip 125 B 125 B
Overall change 9.36 kB 9.36 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 419 B 419 B
Overall change 419 B 419 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 612 B 612 B
link.html gzip 620 B 620 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB
Commit: cd365c0

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Failing test suites

Commit: 5ef08bd

test/integration/amphtml-custom-optimizer/test/index.test.js

  • AMP Custom Optimizer > should build and start for dynamic page
Expand output

● AMP Custom Optimizer › should build and start for dynamic page

expect(received).toContain(expected) // indexOf

Expected substring: "amp-img width=\"500\" height=\"500\" layout=\"responsive\" src=\"https://amp.dev/static/samples/img/story_dog2_portrait.jpg\""
Received string:    "Internal Server Error"

  46 |     await killApp(app)
  47 |
> 48 |     expect(html).toContain(
     |                  ^
  49 |       'amp-img width="500" height="500" layout="responsive" src="https://amp.dev/static/samples/img/story_dog2_portrait.jpg"'
  50 |     )
  51 |     expect(html).toContain('i-amphtml-version="001515617716922"')

  at Object.<anonymous> (integration/amphtml-custom-optimizer/test/index.test.js:48:18)

test/integration/404-page-app/test/index.test.js

  • 404 Page Support with _app > dev mode > should not show pages/404 GIP error if _app has GIP
  • 404 Page Support with _app > production mode > should not output static 404 if _app has getInitialProps
  • 404 Page Support with _app > production mode > should still use 404 page
Expand output

● 404 Page Support with _app › production mode › should not output static 404 if _app has getInitialProps

JavascriptError: javascript error: __NEXT_DATA__ is not defined
  (Session info: headless chrome=90.0.4430.85)

  42 |     it('should not output static 404 if _app has getInitialProps', async () => {
  43 |       const browser = await webdriver(appPort, '/404')
> 44 |       const isAutoExported = await browser.eval('__NEXT_DATA__.autoExport')
     |                              ^
  45 |       expect(isAutoExported).toBe(null)
  46 |     })
  47 |

  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/404-page-app/test/index.test.js:44:30)

● 404 Page Support with _app › production mode › should still use 404 page

expect(received).toBe(expected) // Object.is equality

Expected: 404
Received: 500

  55 |     it('should still use 404 page', async () => {
  56 |       const res = await fetchViaHTTP(appPort, '/abc')
> 57 |       expect(res.status).toBe(404)
     |                          ^
  58 |       const $ = cheerio.load(await res.text())
  59 |       expect($('#404-title').text()).toBe('Hi There')
  60 |     })

  at Object.<anonymous> (integration/404-page-app/test/index.test.js:57:26)

● 404 Page Support with _app › dev mode › should not show pages/404 GIP error if _app has GIP

expect(received).toBe(expected) // Object.is equality

Expected: 404
Received: 500

  80 |     it('should not show pages/404 GIP error if _app has GIP', async () => {
  81 |       const res = await fetchViaHTTP(appPort, '/abc')
> 82 |       expect(res.status).toBe(404)
     |                          ^
  83 |       const $ = cheerio.load(await res.text())
  84 |       expect($('#404-title').text()).toBe('Hi There')
  85 |       expect(stderr).not.toMatch(gip404Err)

  at Object.<anonymous> (integration/404-page-app/test/index.test.js:82:26)

test/integration/app-document-style-fragment/test/index.test.js

  • Custom Document Fragment Styles > correctly adds styles from fragment styles key
Expand output

● Custom Document Fragment Styles › correctly adds styles from fragment styles key

expect(received).toMatch(expected)

Expected pattern: /background:(.*|)hotpink/
Received string:  ""

  36 |
  37 |     const styles = $('style').text()
> 38 |     expect(styles).toMatch(/background:(.*|)hotpink/)
     |                    ^
  39 |     expect(styles).toMatch(/font-size:(.*|)16\.4px/)
  40 |   })
  41 | })

  at Object.<anonymous> (integration/app-document-style-fragment/test/index.test.js:38:20)

test/integration/auto-export/test/index.test.js

  • Auto Export > dev > Supports commonjs 1
  • Auto Export > dev > Supports commonjs 2
  • Auto Export > dev > Refreshes query on mount
  • Auto Export > dev > should update asPath after mount
  • Auto Export > dev > should not replace URL with page name while asPath is delayed
  • Auto Export > dev > should not show hydration warning from mismatching asPath
Expand output

● Auto Export › dev › Supports commonjs 1

expect(received).toMatch(expected)

Expected pattern: /test1/
Received string:  "<pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Internal Server Error</pre>"

  20 |     const browser = await webdriver(appPort, '/commonjs1')
  21 |     const html = await browser.eval('document.body.innerHTML')
> 22 |     expect(html).toMatch(/test1/)
     |                  ^
  23 |     expect(html).toMatch(/nextExport/)
  24 |     await browser.close()
  25 |   })

  at Object.<anonymous> (integration/auto-export/test/index.test.js:22:18)

● Auto Export › dev › Supports commonjs 2

expect(received).toMatch(expected)

Expected pattern: /test2/
Received string:  "<pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Internal Server Error</pre>"

  28 |     const browser = await webdriver(appPort, '/commonjs2')
  29 |     const html = await browser.eval('document.body.innerHTML')
> 30 |     expect(html).toMatch(/test2/)
     |                  ^
  31 |     expect(html).toMatch(/nextExport/)
  32 |     await browser.close()
  33 |   })

  at Object.<anonymous> (integration/auto-export/test/index.test.js:30:18)

● Auto Export › dev › Refreshes query on mount

expect(received).toMatch(expected)

Expected pattern: /post.*post-1/
Received string:  "<pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Internal Server Error</pre>"

  36 |     const browser = await webdriver(appPort, '/post-1')
  37 |     const html = await browser.eval('document.body.innerHTML')
> 38 |     expect(html).toMatch(/post.*post-1/)
     |                  ^
  39 |     expect(html).toMatch(/nextExport/)
  40 |   })
  41 |

  at Object.<anonymous> (integration/auto-export/test/index.test.js:38:18)

● Auto Export › dev › should update asPath after mount

expect(received).toMatch(expected)

Expected pattern: /\/zeit\/cmnt-2/
Received string:  "<head></head><body><pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Internal Server Error</pre></body>"

  43 |     const browser = await webdriver(appPort, '/zeit/cmnt-2')
  44 |     const html = await browser.eval(`document.documentElement.innerHTML`)
> 45 |     expect(html).toMatch(/\/zeit\/cmnt-2/)
     |                  ^
  46 |   })
  47 |
  48 |   it('should not replace URL with page name while asPath is delayed', async () => {

  at Object.<anonymous> (integration/auto-export/test/index.test.js:45:18)

● Auto Export › dev › should not replace URL with page name while asPath is delayed

JavascriptError: javascript error: Cannot read property 'find' of undefined
  (Session info: headless chrome=90.0.4430.85)

  48 |   it('should not replace URL with page name while asPath is delayed', async () => {
  49 |     const browser = await webdriver(appPort, '/zeit/cmnt-1')
> 50 |     const val = await browser.eval(`!!window.pathnames.find(function(p) {
     |                 ^
  51 |       return p !== '/zeit/cmnt-1'
  52 |     })`)
  53 |     expect(val).toBe(false)

  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/auto-export/test/index.test.js:50:17)

● Auto Export › dev › should not show hydration warning from mismatching asPath

expect(received).toEqual(expected) // deep equality

Expected: []
Received: null

  83 |       const browser = await webdriver(appPort, '/zeit/cmnt-1')
  84 |       const caughtWarns = await browser.eval(`window.caughtWarns`)
> 85 |       expect(caughtWarns).toEqual([])
     |                           ^
  86 |     })
  87 |   })
  88 | })

  at Object.<anonymous> (integration/auto-export/test/index.test.js:85:27)

test/integration/css-client-nav/test/index.test.js

  • CSS Module client-side navigation > dev > should be able to client-side navigate from red to blue
  • CSS Module client-side navigation > dev > should be able to client-side navigate from blue to red
  • CSS Module client-side navigation > dev > should be able to client-side navigate from none to red
  • CSS Module client-side navigation > dev > should be able to client-side navigate from none to blue
Expand output

● CSS Module client-side navigation › dev › should be able to client-side navigate from red to blue

JavascriptError: javascript error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
  (Session info: headless chrome=90.0.4430.85)

  34 |       await browser.eval(`window.__did_not_ssr = 'make sure this is set'`)
  35 |
> 36 |       const redColor = await browser.eval(
     |                        ^
  37 |         `window.getComputedStyle(document.querySelector('#verify-red')).color`
  38 |       )
  39 |       expect(redColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`)

  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/css-client-nav/test/index.test.js:36:24)

● CSS Module client-side navigation › dev › should be able to client-side navigate from blue to red

JavascriptError: javascript error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
  (Session info: headless chrome=90.0.4430.85)

  77 |       await browser.eval(`window.__did_not_ssr = 'make sure this is set'`)
  78 |
> 79 |       const redColor = await browser.eval(
     |                        ^
  80 |         `window.getComputedStyle(document.querySelector('#verify-blue')).color`
  81 |       )
  82 |       expect(redColor).toMatchInlineSnapshot(`"rgb(0, 0, 255)"`)

  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/css-client-nav/test/index.test.js:79:24)

● CSS Module client-side navigation › dev › should be able to client-side navigate from none to red

NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"#link-red"}
  (Session info: headless chrome=90.0.4430.85)

  108 |       await browser.eval(`window.__did_not_ssr = 'make sure this is set'`)
  109 |
> 110 |       await browser.elementByCss('#link-red').click()
      |       ^
  111 |       await browser.waitForElementByCss('#verify-red')
  112 |
  113 |       const blueColor = await browser.eval(

  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/css-client-nav/test/index.test.js:110:7)

● CSS Module client-side navigation › dev › should be able to client-side navigate from none to blue

NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"#link-blue"}
  (Session info: headless chrome=90.0.4430.85)

  133 |       await browser.eval(`window.__did_not_ssr = 'make sure this is set'`)
  134 |
> 135 |       await browser.elementByCss('#link-blue').click()
      |       ^
  136 |       await browser.waitForElementByCss('#verify-blue')
  137 |
  138 |       const blueColor = await browser.eval(

  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 runMicrotasks (<anonymous>)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.<anonymous> (integration/css-client-nav/test/index.test.js:135:7)

test/integration/amphtml-ssg/test/index.test.js

  • AMP SSG Support > dev mode > should load an amp first page correctly
  • AMP SSG Support > dev mode > should load a hybrid amp page without query correctly
  • AMP SSG Support > dev mode > should load dynamic hybrid SSG/AMP page
  • AMP SSG Support > dev mode > should load dynamic hybrid SSG/AMP page with trailing slash
  • AMP SSG Support > dev mode > should load dynamic hybrid SSG/AMP page with query
  • AMP SSG Support > dev mode > should load a hybrid amp page with query correctly
Expand output

● AMP SSG Support › dev mode › should load an amp first page correctly

expect(received).toContain(expected) // indexOf

Expected substring: "yes"
Received string:    ""

  37 |     }
  38 |     const $ = cheerio.load(html)
> 39 |     expect($('#use-amp').text()).toContain('yes')
     |                                  ^
  40 |   })
  41 |
  42 |   it('should load a hybrid amp page without query correctly', async () => {

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:39:34)

● AMP SSG Support › dev mode › should load a hybrid amp page without query correctly

expect(received).toContain(expected) // indexOf

Expected substring: "no"
Received string:    ""

  43 |     const html = await renderViaHTTP(appPort, '/hybrid')
  44 |     const $ = cheerio.load(html)
> 45 |     expect($('#use-amp').text()).toContain('no')
     |                                  ^
  46 |     expect($('#hello').text()).toContain('hello')
  47 |   })
  48 |

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:45:34)

● AMP SSG Support › dev mode › should load dynamic hybrid SSG/AMP page

expect(received).toContain(expected) // indexOf

Expected substring: "no"
Received string:    ""

  50 |     const html = await renderViaHTTP(appPort, '/blog/post-1')
  51 |     const $ = cheerio.load(html)
> 52 |     expect($('#use-amp').text()).toContain('no')
     |                                  ^
  53 |     expect($('#hello').text()).toContain('hello')
  54 |     expect($('#slug').text()).toContain('post-1')
  55 |   })

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:52:34)

● AMP SSG Support › dev mode › should load dynamic hybrid SSG/AMP page with trailing slash

expect(received).toContain(expected) // indexOf

Expected substring: "no"
Received string:    ""

  58 |     const html = await renderViaHTTP(appPort, '/blog/post-1/')
  59 |     const $ = cheerio.load(html)
> 60 |     expect($('#use-amp').text()).toContain('no')
     |                                  ^
  61 |     expect($('#hello').text()).toContain('hello')
  62 |     expect($('#slug').text()).toContain('post-1')
  63 |   })

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:60:34)

● AMP SSG Support › dev mode › should load dynamic hybrid SSG/AMP page with query

expect(received).toContain(expected) // indexOf

Expected substring: "yes"
Received string:    ""

  66 |     const html = await renderViaHTTP(appPort, '/blog/post-1?amp=1')
  67 |     const $ = cheerio.load(html)
> 68 |     expect($('#use-amp').text()).toContain('yes')
     |                                  ^
  69 |     expect($('#hello').text()).toContain('hello')
  70 |     expect($('#slug').text()).toContain('post-1')
  71 |   })

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:68:34)

● AMP SSG Support › dev mode › should load a hybrid amp page with query correctly

expect(received).toContain(expected) // indexOf

Expected substring: "yes"
Received string:    ""

  78 |     }
  79 |     const $ = cheerio.load(html)
> 80 |     expect($('#use-amp').text()).toContain('yes')
     |                                  ^
  81 |     expect($('#hello').text()).toContain('hello')
  82 |   })
  83 |

  at Object.<anonymous> (integration/amphtml-ssg/test/index.test.js:80:34)

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 16s 15.2s -815ms
buildDurationCached 5s 4.4s -549ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.52 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.781 2.194 -0.59
/ avg req/sec 899.04 1139.59 +240.55
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.585 1.471 -0.11
/error-in-render avg req/sec 1577.18 1699.04 +121.86
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 608 B N/A N/A
link.html gzip 615 B N/A N/A
withRouter.html gzip 605 B N/A N/A
Overall change 1.83 kB 0 B -1.83 kB

Diffs

Diff for index.html
deleted
Diff for link.html
deleted
Diff for withRouter.html
deleted

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 18.7s 19.3s ⚠️ +604ms
buildDurationCached 7s 7s -50ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.23 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_error.js 1.35 MB 1.35 MB ⚠️ +267 B
404.html 2.76 kB 2.76 kB
500.html 2.75 kB 2.75 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.96 kB 1.96 kB
css.html 2.13 kB 2.13 kB
hooks.html 2.01 kB 2.01 kB
index.js 1.35 MB 1.35 MB ⚠️ +267 B
link.js 1.4 MB 1.4 MB ⚠️ +267 B
routerDirect.js 1.4 MB 1.4 MB ⚠️ +267 B
withRouter.js 1.4 MB 1.4 MB ⚠️ +267 B
Overall change 6.91 MB 6.91 MB ⚠️ +1.33 kB

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 12.5s 12.6s ⚠️ +108ms
buildDurationCached 5.3s 5.3s ⚠️ +31ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.23 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.622 2.147 -0.48
/ avg req/sec 953.64 1164.63 +210.99
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.541 1.426 -0.11
/error-in-render avg req/sec 1622.65 1753.36 +130.71
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.19 kB 7.19 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.2 kB 60.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.28 kB 1.28 kB
_error-HASH.js gzip 3.71 kB 3.71 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 339 B 339 B
hooks-HASH.js gzip 887 B 887 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 303 B 303 B
withRouter-HASH.js gzip 302 B 302 B
21c68fa65a48..217.css gzip 125 B 125 B
Overall change 9.36 kB 9.36 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 419 B 419 B
Overall change 419 B 419 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 612 B N/A N/A
link.html gzip 620 B N/A N/A
withRouter.html gzip 607 B N/A N/A
Overall change 1.84 kB 0 B -1.84 kB

Diffs

Diff for index.html
deleted
Diff for link.html
deleted
Diff for withRouter.html
deleted
Commit: 5ef08bd

@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 14.2s 13.9s -279ms
buildDurationCached 4.5s 4.2s -302ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.17 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.523 2.452 -0.07
/ avg req/sec 991.06 1019.47 +28.41
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.421 1.451 ⚠️ +0.03
/error-in-render avg req/sec 1759.61 1722.63 ⚠️ -36.98
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 608 B 608 B
link.html gzip 615 B 615 B
withRouter.html gzip 605 B 605 B
Overall change 1.83 kB 1.83 kB

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 17.5s 17.3s -220ms
buildDurationCached 6.4s 6.4s ⚠️ +81ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.17 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
597-HASH.js gzip 13.2 kB 13.2 kB
778-HASH.js gzip 7.12 kB 7.12 kB
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.7 kB 60.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.3 kB 1.3 kB
_error-HASH.js gzip 3.68 kB 3.68 kB
amp-HASH.js gzip 558 B 558 B
css-HASH.js gzip 363 B 363 B
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 243 B 243 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 336 B 336 B
withRouter-HASH.js gzip 334 B 334 B
99a142a5cfae..804.css gzip 125 B 125 B
Overall change 9.52 kB 9.52 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_error.js 1.35 MB 1.35 MB ⚠️ +267 B
404.html 2.76 kB 2.76 kB
500.html 2.75 kB 2.75 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.96 kB 1.96 kB
css.html 2.13 kB 2.13 kB
hooks.html 2.01 kB 2.01 kB
index.js 1.35 MB 1.35 MB ⚠️ +267 B
link.js 1.4 MB 1.4 MB ⚠️ +269 B
routerDirect.js 1.4 MB 1.4 MB ⚠️ +267 B
withRouter.js 1.4 MB 1.4 MB ⚠️ +267 B
Overall change 6.91 MB 6.91 MB ⚠️ +1.34 kB

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js concurrent-next-x Change
buildDuration 11.6s 11.8s ⚠️ +134ms
buildDurationCached 4.8s 4.8s -6ms
nodeModulesSize 46.6 MB 46.6 MB ⚠️ +5.17 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js concurrent-next-x Change
/ failed reqs 0 0
/ total time (seconds) 2.546 2.538 -0.01
/ avg req/sec 981.88 985.05 +3.17
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.589 1.561 -0.03
/error-in-render avg req/sec 1573.49 1601.68 +28.19
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.19 kB 7.19 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.2 kB 60.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js concurrent-next-x Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_app-HASH.js gzip 1.28 kB 1.28 kB
_error-HASH.js gzip 3.71 kB 3.71 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 339 B 339 B
hooks-HASH.js gzip 887 B 887 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 303 B 303 B
withRouter-HASH.js gzip 302 B 302 B
21c68fa65a48..217.css gzip 125 B 125 B
Overall change 9.36 kB 9.36 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js concurrent-next-x Change
_buildManifest.js gzip 419 B 419 B
Overall change 419 B 419 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js concurrent-next-x Change
index.html gzip 612 B 612 B
link.html gzip 620 B 620 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB
Commit: 95db099

@huozhi
Copy link
Member

huozhi commented Aug 24, 2021

Closed via #27768

@huozhi huozhi closed this Aug 24, 2021
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 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