fix netlify deploy output and uploads (#2107)
Co-authored-by: embire2 <ceo@openweb.co.za>
This commit is contained in:
@@ -7,6 +7,7 @@ import { path } from '~/utils/path';
|
||||
import { useState } from 'react';
|
||||
import type { ActionCallbackData } from '~/lib/runtime/message-parser';
|
||||
import { chatId } from '~/lib/persistence/useChatHistory';
|
||||
import { formatBuildFailureOutput } from './deployUtils';
|
||||
|
||||
export function useVercelDeploy() {
|
||||
const [isDeploying, setIsDeploying] = useState(false);
|
||||
@@ -64,10 +65,12 @@ export function useVercelDeploy() {
|
||||
// Then run it
|
||||
await artifact.runner.runAction(actionData);
|
||||
|
||||
if (!artifact.runner.buildOutput) {
|
||||
const buildOutput = artifact.runner.buildOutput;
|
||||
|
||||
if (!buildOutput || buildOutput.exitCode !== 0) {
|
||||
// Notify that build failed
|
||||
deployArtifact.runner.handleDeployAction('building', 'failed', {
|
||||
error: 'Build failed. Check the terminal for details.',
|
||||
error: formatBuildFailureOutput(buildOutput?.output),
|
||||
source: 'vercel',
|
||||
});
|
||||
throw new Error('Build failed');
|
||||
@@ -80,7 +83,7 @@ export function useVercelDeploy() {
|
||||
const container = await webcontainer;
|
||||
|
||||
// Remove /home/project from buildPath if it exists
|
||||
const buildPath = artifact.runner.buildOutput.path.replace('/home/project', '');
|
||||
const buildPath = buildOutput.path.replace('/home/project', '');
|
||||
|
||||
// Check if the build path exists
|
||||
let finalBuildPath = buildPath;
|
||||
|
||||
Reference in New Issue
Block a user