mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 12:57:47 +00:00
[next] Support pre-generated pages without fallbacks with Partial Prerendering (#11183)
This commit is contained in:
@@ -119,16 +119,28 @@ async function disableSSO(deploymentId, useTeam = true) {
|
||||
}
|
||||
);
|
||||
|
||||
const text = await deployRes.text();
|
||||
|
||||
if (!deployRes.ok) {
|
||||
throw new Error(
|
||||
`Failed to get deployment info (status: ${
|
||||
deployRes.status
|
||||
}, body: ${await deployRes.text()})`
|
||||
`Failed to get deployment info (status: ${deployRes.status}, body: ${text})`
|
||||
);
|
||||
}
|
||||
|
||||
const deploymentInfo = await deployRes.json();
|
||||
const { projectId, url: deploymentUrl } = deploymentInfo;
|
||||
let info;
|
||||
try {
|
||||
info = JSON.parse(text);
|
||||
} catch (err) {
|
||||
throw new Error('Failed to parse deployment info JSON', { cause: err });
|
||||
}
|
||||
|
||||
const { projectId, url: deploymentUrl } = info;
|
||||
|
||||
if (!deploymentUrl || typeof deploymentUrl !== 'string') {
|
||||
throw new Error(
|
||||
`Failed to get deployment URL (status: ${deployRes.status}, body: ${text})`
|
||||
);
|
||||
}
|
||||
|
||||
const settingRes = await fetchWithAuth(
|
||||
`https://vercel.com/api/v5/projects/${encodeURIComponent(projectId)}`,
|
||||
@@ -160,7 +172,7 @@ async function disableSSO(deploymentId, useTeam = true) {
|
||||
`Disabled deployment protection for deploymentId: ${deploymentId} projectId: ${projectId}`
|
||||
);
|
||||
} else {
|
||||
console.error(settingRes.status, await settingRes.text(), deploymentInfo);
|
||||
console.error(settingRes.status, await settingRes.text(), text);
|
||||
throw new Error(
|
||||
`Failed to disable deployment protection projectId: ${projectId} deploymentId ${deploymentId}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user