Skip to content

Commit

Permalink
fix generate error
Browse files Browse the repository at this point in the history
  • Loading branch information
SeferMirza committed Oct 12, 2023
1 parent 4ba8711 commit 9762959
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 39 deletions.
18 changes: 18 additions & 0 deletions .theme/error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div>
<p><strong>Error Status Code:</strong> {{ error.statusCode }}</p>
<p><strong>Error Message:</strong> {{ error.statusMessage }}</p>
<button @click="clearError({ redirect: '/' })">
Clear errors and route home
</button>
</div>
</template>
<script setup>
import { clearError } from "#app";
defineProps({
error: {
type: Object,
default: null
}
});
</script>
7 changes: 6 additions & 1 deletion .theme/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ export default defineNuxtConfig({
}
}
},
css: ["~/assets/styles.scss"]
css: ["~/assets/styles.scss"],
nitro: {
prerender: {
ignore: ["/demo/error/non-existent-content"]
}
}
});
10 changes: 10 additions & 0 deletions setup-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,13 @@ add them under `/modules`, you don't need to add those local modules to your
To see the use of transformer `/transformers/optimus-prime.ts`
To see how to add a module look `nuxt.config.ts`.
### prerender fail
After version nuxt 3.6.2, if a page corresponding to the link cannot be found,
it gives generate error.
For solution you can make `nitro.prerender.failOnError` `false` or add path to
`nitro.prerender.ignore` array.
See `nuxt.config.ts` for example.
5 changes: 0 additions & 5 deletions theme-legacy/app.vue

This file was deleted.

13 changes: 0 additions & 13 deletions theme-legacy/transformers/optimus-prime.ts

This file was deleted.

16 changes: 0 additions & 16 deletions theme-legacy/transformers/transformer-module.ts

This file was deleted.

3 changes: 0 additions & 3 deletions theme-legacy/types/Demo.ts

This file was deleted.

1 change: 0 additions & 1 deletion theme-legacy/types/index.ts

This file was deleted.

0 comments on commit 9762959

Please sign in to comment.