Error on state fail in prod and log endpoint errors (#5167)

* Error on state fail in prod and log endpoint errors

* brint back eslint suppress

* lint
This commit is contained in:
Prospector
2026-01-20 13:16:25 -08:00
committed by GitHub
parent 9f6db31785
commit 8f5185de1c
2 changed files with 27 additions and 14 deletions

View File

@@ -166,6 +166,17 @@ export default defineNuxtConfig({
await fs.writeFile('./src/generated/state.json', JSON.stringify(state))
// throw if errors and building for prod (preview & staging allowed to have errors)
if (
process.env.BUILD_ENV === 'production' &&
process.env.PREVIEW !== 'true' &&
generatedState.errors.length > 0
) {
throw new Error(
`Production build failed: State generation encountered errors. Error codes: ${JSON.stringify(generatedState.errors)}; API URL: ${API_URL}`,
)
}
console.log('Tags generated!')
const robotsContent =