Skip to content

Commit

Permalink
fix(frontend): fix build error when API is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
Data5tream committed Jul 7, 2023
1 parent 501a3e7 commit 7c87756
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions frontend/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@ import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
preprocess: vitePreprocess(),

kit: {
adapter: adapter()
}
kit: {
adapter: adapter(),
prerender: {
handleHttpError: ({ path, message }) => {
// ignore unavailable API endpoint during prerender
if (path === '/status') {
return;
}

// otherwise fail the build
throw new Error(message);
}
}
},
};

export default config;

0 comments on commit 7c87756

Please sign in to comment.