@@ -161,7 +161,7 @@ export async function setupFsCheck(opts: {
...
@@ -161,7 +161,7 @@ export async function setupFsCheck(opts: {
},
},
headers:[],
headers:[],
}
}
letbuildId:string|undefined
letbuildId='development'
letprerenderManifest:PrerenderManifest
letprerenderManifest:PrerenderManifest
if(!opts.dev){
if(!opts.dev){
...
@@ -170,6 +170,9 @@ export async function setupFsCheck(opts: {
...
@@ -170,6 +170,9 @@ export async function setupFsCheck(opts: {
buildId=awaitfs.readFile(buildIdPath,'utf8')
buildId=awaitfs.readFile(buildIdPath,'utf8')
}catch(err:any){
}catch(err:any){
if(err.code!=='ENOENT')throwerr
if(err.code!=='ENOENT')throwerr
thrownewError(
`Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`
)
}
}
try{
try{
...
@@ -227,12 +230,7 @@ export async function setupFsCheck(opts: {
...
@@ -227,12 +230,7 @@ export async function setupFsCheck(opts: {
`Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`
)
})
)asRoutesManifest
)asRoutesManifest
prerenderManifest=JSON.parse(
prerenderManifest=JSON.parse(
...
@@ -347,8 +345,6 @@ export async function setupFsCheck(opts: {
...
@@ -347,8 +345,6 @@ export async function setupFsCheck(opts: {