summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2022-09-12 11:55:06 -0300
committerGravatar GitHub <noreply@github.com> 2022-09-12 11:55:06 -0300
commit5b6173fd031b7e85974cbadd39de7fa199075e44 (patch)
tree6fdc8d708f4351932853fd1e36b5e4ce9f9fb5e6
parentee03967f9249dc91d2b02bf4c731bfe069d1fb67 (diff)
downloadastro-5b6173fd031b7e85974cbadd39de7fa199075e44.tar.gz
astro-5b6173fd031b7e85974cbadd39de7fa199075e44.tar.zst
astro-5b6173fd031b7e85974cbadd39de7fa199075e44.zip
Add an error message for improperly configured renderers (#4705)
* Add error messages for wrongly configured renderers * Add changeset
-rw-r--r--.changeset/fuzzy-rats-remain.md5
-rw-r--r--packages/astro/src/integrations/index.ts8
2 files changed, 13 insertions, 0 deletions
diff --git a/.changeset/fuzzy-rats-remain.md b/.changeset/fuzzy-rats-remain.md
new file mode 100644
index 000000000..601d2483b
--- /dev/null
+++ b/.changeset/fuzzy-rats-remain.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Properly show an error message when a renderer is not properly configured
diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts
index ba9cac2c8..68d2a23ae 100644
--- a/packages/astro/src/integrations/index.ts
+++ b/packages/astro/src/integrations/index.ts
@@ -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) => {