Fix serverless with next start error case (#19288)
This fixes the case where we were returning page data when rendering `/_error` in `serverless` mode with `next start` Closes: https://github.com/vercel/next.js/issues/19068
This commit is contained in:
parent
ce7ca2487b
commit
8193df5309
2 changed files with 6 additions and 1 deletions
|
@ -631,7 +631,7 @@ const nextServerlessLoader: loader.Loader = function () {
|
|||
const {
|
||||
default: getRouteNoAssetPath,
|
||||
} = require('next/dist/next-server/lib/router/utils/get-route-from-asset-path');
|
||||
_nextData = true;
|
||||
_nextData = ${page === '/_error' ? 'false' : 'true'};
|
||||
parsedUrl.pathname = getRouteNoAssetPath(
|
||||
parsedUrl.pathname.replace(
|
||||
new RegExp('/_next/data/${escapedBuildId}/'),
|
||||
|
|
|
@ -1785,6 +1785,11 @@ const runTests = (dev = false, isEmulatedServerless = false) => {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
// this should come very last
|
||||
it('should not have attempted sending invalid payload', async () => {
|
||||
expect(stderr).not.toContain('argument entity must be string')
|
||||
})
|
||||
}
|
||||
|
||||
describe('SSG Prerender', () => {
|
||||
|
|
Loading…
Reference in a new issue