Add an error message for improperly configured renderers (#4705)
* Add error messages for wrongly configured renderers * Add changeset
This commit is contained in:
parent
ee03967f92
commit
5b6173fd03
2 changed files with 13 additions and 0 deletions
5
.changeset/fuzzy-rats-remain.md
Normal file
5
.changeset/fuzzy-rats-remain.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Properly show an error message when a renderer is not properly configured
|
|
@ -66,6 +66,14 @@ export async function runHookConfigSetup({
|
|||
config: updatedConfig,
|
||||
command,
|
||||
addRenderer(renderer: AstroRenderer) {
|
||||
if (!renderer.name) {
|
||||
throw new Error(`Integration ${bold(integration.name)} has an unnamed renderer.`);
|
||||
}
|
||||
|
||||
if (!renderer.serverEntrypoint) {
|
||||
throw new Error(`Renderer ${bold(renderer.name)} does not provide a serverEntrypoint.`);
|
||||
}
|
||||
|
||||
updatedConfig._ctx.renderers.push(renderer);
|
||||
},
|
||||
injectScript: (stage, content) => {
|
||||
|
|
Loading…
Reference in a new issue