astro 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-base.d.ts +2 -1
- package/client-image.d.ts +7 -14
- package/dist/@types/astro.d.ts +2 -2
- package/dist/@types/typed-emitter.d.ts +1 -2
- package/dist/assets/consts.d.ts +5 -1
- package/dist/assets/consts.js +8 -3
- package/dist/assets/image-endpoint.js +1 -1
- package/dist/assets/internal.d.ts +3 -2
- package/dist/assets/internal.js +10 -5
- package/dist/assets/services/service.d.ts +15 -4
- package/dist/assets/services/service.js +35 -29
- package/dist/assets/services/sharp.d.ts +1 -1
- package/dist/assets/services/sharp.js +5 -4
- package/dist/assets/services/squoosh.d.ts +1 -1
- package/dist/assets/services/squoosh.js +7 -4
- package/dist/assets/services/vendor/squoosh/codecs.js +2 -0
- package/dist/assets/services/vendor/squoosh/image-pool.js +2 -0
- package/dist/assets/services/vendor/squoosh/impl.js +2 -0
- package/dist/assets/types.d.ts +3 -3
- package/dist/assets/utils/emitAsset.d.ts +2 -0
- package/dist/assets/utils/emitAsset.js +31 -0
- package/dist/assets/utils/metadata.d.ts +1 -1
- package/dist/assets/utils/metadata.js +2 -4
- package/dist/assets/utils/queryParams.d.ts +1 -1
- package/dist/assets/utils/transformToPath.d.ts +1 -1
- package/dist/assets/vendor/image-size/detector.d.ts +3 -0
- package/dist/assets/vendor/image-size/detector.js +28 -0
- package/dist/assets/vendor/image-size/index.d.ts +11 -0
- package/dist/assets/vendor/image-size/index.js +93 -0
- package/dist/assets/vendor/image-size/readUInt.d.ts +4 -0
- package/dist/assets/vendor/image-size/readUInt.js +9 -0
- package/dist/assets/vendor/image-size/types/bmp.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/bmp.js +14 -0
- package/dist/assets/vendor/image-size/types/cur.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/cur.js +16 -0
- package/dist/assets/vendor/image-size/types/dds.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/dds.js +14 -0
- package/dist/assets/vendor/image-size/types/gif.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/gif.js +16 -0
- package/dist/assets/vendor/image-size/types/icns.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/icns.js +87 -0
- package/dist/assets/vendor/image-size/types/ico.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/ico.js +42 -0
- package/dist/assets/vendor/image-size/types/interface.d.ts +14 -0
- package/dist/assets/vendor/image-size/types/interface.js +0 -0
- package/dist/assets/vendor/image-size/types/j2c.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/j2c.js +14 -0
- package/dist/assets/vendor/image-size/types/jp2.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/jp2.js +56 -0
- package/dist/assets/vendor/image-size/types/jpg.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/jpg.js +95 -0
- package/dist/assets/vendor/image-size/types/ktx.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/ktx.js +15 -0
- package/dist/assets/vendor/image-size/types/png.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/png.js +33 -0
- package/dist/assets/vendor/image-size/types/pnm.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/pnm.js +72 -0
- package/dist/assets/vendor/image-size/types/psd.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/psd.js +14 -0
- package/dist/assets/vendor/image-size/types/svg.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/svg.js +91 -0
- package/dist/assets/vendor/image-size/types/tiff.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/tiff.js +81 -0
- package/dist/assets/vendor/image-size/types/webp.d.ts +2 -0
- package/dist/assets/vendor/image-size/types/webp.js +51 -0
- package/dist/assets/vendor/image-size/types.d.ts +19 -0
- package/dist/assets/vendor/image-size/types.js +37 -0
- package/dist/assets/vendor/queue/queue.d.ts +39 -0
- package/dist/assets/vendor/queue/queue.js +187 -0
- package/dist/assets/vite-plugin-assets.d.ts +1 -1
- package/dist/assets/vite-plugin-assets.js +29 -25
- package/dist/cli/check/index.js +43 -2
- package/dist/cli/check/print.d.ts +1 -1
- package/dist/content/error-map.d.ts +2 -0
- package/dist/content/error-map.js +78 -0
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.js +2 -0
- package/dist/content/runtime-assets.d.ts +8 -0
- package/dist/content/runtime-assets.js +24 -0
- package/dist/content/{internal.d.ts → runtime.d.ts} +1 -19
- package/dist/content/{internal.js → runtime.js} +28 -43
- package/dist/content/server-listeners.d.ts +1 -1
- package/dist/content/template/virtual-mod-assets.d.mts +1 -0
- package/dist/content/template/virtual-mod.d.mts +0 -1
- package/dist/content/types-generator.d.ts +3 -3
- package/dist/content/types-generator.js +3 -0
- package/dist/content/utils.d.ts +9 -4
- package/dist/content/utils.js +20 -26
- package/dist/content/vite-plugin-content-assets.d.ts +3 -3
- package/dist/content/vite-plugin-content-imports.d.ts +1 -1
- package/dist/content/vite-plugin-content-imports.js +4 -10
- package/dist/content/vite-plugin-content-virtual-mod.js +8 -3
- package/dist/core/add/index.d.ts +1 -1
- package/dist/core/add/index.js +25 -8
- package/dist/core/app/index.js +4 -1
- package/dist/core/app/node.d.ts +2 -2
- package/dist/core/build/add-rollup-input.d.ts +1 -1
- package/dist/core/build/css-asset-name.d.ts +1 -1
- package/dist/core/build/generate.d.ts +1 -1
- package/dist/core/build/generate.js +5 -1
- package/dist/core/build/index.d.ts +1 -1
- package/dist/core/build/index.js +4 -0
- package/dist/core/build/internal.d.ts +16 -6
- package/dist/core/build/internal.js +2 -2
- package/dist/core/build/plugin.js +1 -0
- package/dist/core/build/plugins/index.js +2 -0
- package/dist/core/build/plugins/plugin-alias-resolve.d.ts +1 -1
- package/dist/core/build/plugins/plugin-analyzer.js +12 -2
- package/dist/core/build/plugins/plugin-component-entry.d.ts +11 -0
- package/dist/core/build/plugins/plugin-component-entry.js +74 -0
- package/dist/core/build/plugins/plugin-css.d.ts +1 -1
- package/dist/core/build/plugins/plugin-hoisted-scripts.d.ts +2 -2
- package/dist/core/build/plugins/plugin-internals.js +2 -1
- package/dist/core/build/plugins/plugin-pages.d.ts +1 -1
- package/dist/core/build/plugins/plugin-ssr.d.ts +1 -1
- package/dist/core/build/static-build.d.ts +1 -1
- package/dist/core/build/static-build.js +6 -3
- package/dist/core/compile/cache.d.ts +1 -1
- package/dist/core/compile/style.d.ts +1 -1
- package/dist/core/config/config.d.ts +1 -1
- package/dist/core/config/schema.d.ts +37 -37
- package/dist/core/config/schema.js +9 -1
- package/dist/core/config/timer.js +9 -0
- package/dist/core/config/tsconfig.js +4 -0
- package/dist/core/config/vite-load.js +3 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/cookies.js +35 -1
- package/dist/core/create-vite.js +35 -4
- package/dist/core/dev/container.d.ts +2 -2
- package/dist/core/dev/container.js +1 -0
- package/dist/core/dev/dev.d.ts +3 -3
- package/dist/core/dev/dev.js +2 -1
- package/dist/core/endpoint/index.d.ts +1 -1
- package/dist/core/endpoint/index.js +1 -0
- package/dist/core/errors/dev/utils.d.ts +1 -1
- package/dist/core/errors/dev/utils.js +2 -1
- package/dist/core/errors/dev/vite.d.ts +1 -1
- package/dist/core/errors/dev/vite.js +1 -0
- package/dist/core/errors/errors-data.js +489 -4
- package/dist/core/errors/errors.d.ts +1 -1
- package/dist/core/errors/errors.js +2 -0
- package/dist/core/errors/overlay.js +16 -5
- package/dist/core/errors/utils.d.ts +2 -2
- package/dist/core/logger/console.js +1 -1
- package/dist/core/logger/node.js +1 -1
- package/dist/core/messages.d.ts +3 -3
- package/dist/core/messages.js +2 -2
- package/dist/core/module-loader/loader.d.ts +3 -3
- package/dist/core/preview/static-preview-server.d.ts +1 -1
- package/dist/core/preview/vite-plugin-astro-preview.d.ts +2 -2
- package/dist/core/render/dev/css.d.ts +1 -1
- package/dist/core/render/dev/css.js +2 -1
- package/dist/core/render/dev/environment.js +1 -0
- package/dist/core/render/dev/index.js +1 -0
- package/dist/core/render/dev/resolve.js +1 -6
- package/dist/core/render/dev/vite.js +13 -1
- package/dist/core/render/index.d.ts +1 -1
- package/dist/core/render/paginate.d.ts +1 -1
- package/dist/core/render/result.d.ts +1 -1
- package/dist/core/render/result.js +4 -0
- package/dist/core/render/route-cache.d.ts +1 -1
- package/dist/core/render/route-cache.js +1 -0
- package/dist/core/routing/manifest/create.js +4 -1
- package/dist/core/sync/index.d.ts +1 -1
- package/dist/core/sync/index.js +1 -0
- package/dist/events/error.d.ts +2 -2
- package/dist/integrations/index.d.ts +2 -2
- package/dist/jsx/renderer.js +1 -0
- package/dist/runtime/client/visible.prebuilt.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.js +1 -1
- package/dist/runtime/server/hydration.js +1 -0
- package/dist/runtime/server/jsx.d.ts +1 -1
- package/dist/runtime/server/render/scope.js +5 -0
- package/dist/runtime/server/render/tags.d.ts +1 -1
- package/dist/runtime/server/scripts.js +2 -2
- package/dist/vite-plugin-astro/compile.d.ts +3 -3
- package/dist/vite-plugin-astro/compile.js +1 -0
- package/dist/vite-plugin-astro/index.js +7 -1
- package/dist/vite-plugin-astro-server/base.d.ts +1 -1
- package/dist/vite-plugin-astro-server/common.d.ts +1 -1
- package/dist/vite-plugin-astro-server/plugin.d.ts +1 -1
- package/dist/vite-plugin-astro-server/response.js +2 -2
- package/dist/vite-plugin-astro-server/route.d.ts +1 -1
- package/dist/vite-plugin-config-alias/index.d.ts +2 -7
- package/dist/vite-plugin-config-alias/index.js +32 -41
- package/dist/vite-plugin-env/index.js +1 -0
- package/dist/vite-plugin-head-propagation/index.d.ts +1 -1
- package/dist/vite-plugin-html/transform/slots.d.ts +1 -1
- package/dist/vite-plugin-html/transform/utils.d.ts +1 -1
- package/dist/vite-plugin-inject-env-ts/index.d.ts +2 -2
- package/dist/vite-plugin-inject-env-ts/index.js +5 -1
- package/dist/vite-plugin-integrations-container/index.d.ts +3 -3
- package/dist/vite-plugin-jsx/import-source.d.ts +2 -2
- package/dist/vite-plugin-jsx/index.d.ts +1 -1
- package/dist/vite-plugin-jsx/index.js +7 -1
- package/dist/vite-plugin-jsx/tag.js +7 -0
- package/dist/vite-plugin-markdown/content-entry-type.d.ts +1 -1
- package/dist/vite-plugin-markdown/index.js +12 -4
- package/dist/vite-plugin-scanner/index.d.ts +2 -2
- package/dist/vite-plugin-scanner/scan.d.ts +1 -1
- package/dist/vite-plugin-scripts/index.d.ts +2 -2
- package/dist/vite-plugin-scripts/page-ssr.d.ts +2 -2
- package/package.json +7 -6
- package/src/content/template/types.d.ts +12 -1
- package/src/content/template/virtual-mod-assets.mjs +7 -0
- package/src/content/template/virtual-mod.mjs +1 -7
- package/tsconfigs/base.json +4 -1
|
@@ -1,44 +1,137 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const AstroErrorData = {
|
|
2
|
+
/**
|
|
3
|
+
* @docs
|
|
4
|
+
* @kind heading
|
|
5
|
+
* @name Astro Errors
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @docs
|
|
9
|
+
* @message
|
|
10
|
+
* Unknown compiler error.
|
|
11
|
+
* @see
|
|
12
|
+
* - [withastro/compiler issues list](https://astro.build/issues/compiler)
|
|
13
|
+
* @description
|
|
14
|
+
* Astro encountered an unknown error while compiling your files. In most cases, this is not your fault, but an issue in our compiler.
|
|
15
|
+
*
|
|
16
|
+
* If there isn't one already, please [create an issue](https://astro.build/issues/compiler).
|
|
17
|
+
*/
|
|
3
18
|
UnknownCompilerError: {
|
|
4
19
|
title: "Unknown compiler error.",
|
|
5
20
|
code: 1e3,
|
|
6
21
|
hint: "This is almost always a problem with the Astro compiler, not your code. Please open an issue at https://astro.build/issues/compiler."
|
|
7
22
|
},
|
|
23
|
+
// 1xxx and 2xxx codes are reserved for compiler errors and warnings respectively
|
|
24
|
+
/**
|
|
25
|
+
* @docs
|
|
26
|
+
* @see
|
|
27
|
+
* - [Enabling SSR in Your Project](https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project)
|
|
28
|
+
* - [Astro.redirect](https://docs.astro.build/en/guides/server-side-rendering/#astroredirect)
|
|
29
|
+
* @description
|
|
30
|
+
* The `Astro.redirect` function is only available when [Server-side rendering](/en/guides/server-side-rendering/) is enabled.
|
|
31
|
+
*
|
|
32
|
+
* To redirect on a static website, the [meta refresh attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) can be used. Certain hosts also provide config-based redirects (ex: [Netlify redirects](https://docs.netlify.com/routing/redirects/)).
|
|
33
|
+
*/
|
|
8
34
|
StaticRedirectNotAvailable: {
|
|
9
35
|
title: "`Astro.redirect` is not available in static mode.",
|
|
10
36
|
code: 3001,
|
|
11
37
|
message: "Redirects are only available when using `output: 'server'`. Update your Astro config if you need SSR features.",
|
|
12
38
|
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR."
|
|
13
39
|
},
|
|
40
|
+
/**
|
|
41
|
+
* @docs
|
|
42
|
+
* @see
|
|
43
|
+
* - [Official integrations](https://docs.astro.build/en/guides/integrations-guide/#official-integrations)
|
|
44
|
+
* - [Astro.clientAddress](https://docs.astro.build/en/reference/api-reference/#astroclientaddress)
|
|
45
|
+
* @description
|
|
46
|
+
* The adapter you're using unfortunately does not support `Astro.clientAddress`.
|
|
47
|
+
*/
|
|
14
48
|
ClientAddressNotAvailable: {
|
|
15
49
|
title: "`Astro.clientAddress` is not available in current adapter.",
|
|
16
50
|
code: 3002,
|
|
17
51
|
message: (adapterName) => `\`Astro.clientAddress\` is not available in the \`${adapterName}\` adapter. File an issue with the adapter to add support.`
|
|
18
52
|
},
|
|
53
|
+
/**
|
|
54
|
+
* @docs
|
|
55
|
+
* @see
|
|
56
|
+
* - [Enabling SSR in Your Project](https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project)
|
|
57
|
+
* - [Astro.clientAddress](https://docs.astro.build/en/reference/api-reference/#astroclientaddress)
|
|
58
|
+
* @description
|
|
59
|
+
* The `Astro.clientAddress` property is only available when [Server-side rendering](https://docs.astro.build/en/guides/server-side-rendering/) is enabled.
|
|
60
|
+
*
|
|
61
|
+
* To get the user's IP address in static mode, different APIs such as [Ipify](https://www.ipify.org/) can be used in a [Client-side script](https://docs.astro.build/en/guides/client-side-scripts/) or it may be possible to get the user's IP using a serverless function hosted on your hosting provider.
|
|
62
|
+
*/
|
|
19
63
|
StaticClientAddressNotAvailable: {
|
|
20
64
|
title: "`Astro.clientAddress` is not available in static mode.",
|
|
21
65
|
code: 3003,
|
|
22
66
|
message: "`Astro.clientAddress` is only available when using `output: 'server'`. Update your Astro config if you need SSR features.",
|
|
23
67
|
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR."
|
|
24
68
|
},
|
|
69
|
+
/**
|
|
70
|
+
* @docs
|
|
71
|
+
* @see
|
|
72
|
+
* - [getStaticPaths()](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
73
|
+
* @description
|
|
74
|
+
* A [dynamic route](https://docs.astro.build/en/core-concepts/routing/#dynamic-routes) was matched, but no corresponding path was found for the requested parameters. This is often caused by a typo in either the generated or the requested path.
|
|
75
|
+
*/
|
|
25
76
|
NoMatchingStaticPathFound: {
|
|
26
77
|
title: "No static path found for requested path.",
|
|
27
78
|
code: 3004,
|
|
28
79
|
message: (pathName) => `A \`getStaticPaths()\` route pattern was matched, but no matching static path was found for requested path \`${pathName}\`.`,
|
|
29
80
|
hint: (possibleRoutes) => `Possible dynamic routes being matched: ${possibleRoutes.join(", ")}.`
|
|
30
81
|
},
|
|
82
|
+
/**
|
|
83
|
+
* @docs
|
|
84
|
+
* @message Route returned a `RETURNED_VALUE`. Only a Response can be returned from Astro files.
|
|
85
|
+
* @see
|
|
86
|
+
* - [Response](https://docs.astro.build/en/guides/server-side-rendering/#response)
|
|
87
|
+
* @description
|
|
88
|
+
* Only instances of [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned inside Astro files.
|
|
89
|
+
* ```astro title="pages/login.astro"
|
|
90
|
+
* ---
|
|
91
|
+
* return new Response(null, {
|
|
92
|
+
* status: 404,
|
|
93
|
+
* statusText: 'Not found'
|
|
94
|
+
* });
|
|
95
|
+
*
|
|
96
|
+
* // Alternatively, for redirects, Astro.redirect also returns an instance of Response
|
|
97
|
+
* return Astro.redirect('/login');
|
|
98
|
+
* ---
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
31
102
|
OnlyResponseCanBeReturned: {
|
|
32
103
|
title: "Invalid type returned by Astro page.",
|
|
33
104
|
code: 3005,
|
|
34
105
|
message: (route, returnedValue) => `Route \`${route ? route : ""}\` returned a \`${returnedValue}\`. Only a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from Astro files.`,
|
|
35
106
|
hint: "See https://docs.astro.build/en/guides/server-side-rendering/#response for more information."
|
|
36
107
|
},
|
|
108
|
+
/**
|
|
109
|
+
* @docs
|
|
110
|
+
* @see
|
|
111
|
+
* - [`client:media`](https://docs.astro.build/en/reference/directives-reference/#clientmedia)
|
|
112
|
+
* @description
|
|
113
|
+
* A [media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) parameter is required when using the `client:media` directive.
|
|
114
|
+
*
|
|
115
|
+
* ```astro
|
|
116
|
+
* <Counter client:media="(max-width: 640px)" />
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
37
119
|
MissingMediaQueryDirective: {
|
|
38
120
|
title: "Missing value for `client:media` directive.",
|
|
39
121
|
code: 3006,
|
|
40
122
|
message: 'Media query not provided for `client:media` directive. A media query similar to `client:media="(max-width: 600px)"` must be provided'
|
|
41
123
|
},
|
|
124
|
+
/**
|
|
125
|
+
* @docs
|
|
126
|
+
* @message Unable to render `COMPONENT_NAME`. There are `RENDERER_COUNT` renderer(s) configured in your `astro.config.mjs` file, but none were able to server-side render `COMPONENT_NAME`.
|
|
127
|
+
* @see
|
|
128
|
+
* - [Frameworks components](https://docs.astro.build/en/core-concepts/framework-components/)
|
|
129
|
+
* - [UI Frameworks](https://docs.astro.build/en/guides/integrations-guide/#official-integrations)
|
|
130
|
+
* @description
|
|
131
|
+
* None of the installed integrations were able to render the component you imported. Make sure to install the appropriate integration for the type of component you are trying to include in your page.
|
|
132
|
+
*
|
|
133
|
+
* For JSX / TSX files, [@astrojs/react](https://docs.astro.build/en/guides/integrations-guide/react/), [@astrojs/preact](https://docs.astro.build/en/guides/integrations-guide/preact/) or [@astrojs/solid-js](https://docs.astro.build/en/guides/integrations-guide/solid-js/) can be used. For Vue and Svelte files, the [@astrojs/vue](https://docs.astro.build/en/guides/integrations-guide/vue/) and [@astrojs/svelte](https://docs.astro.build/en/guides/integrations-guide/svelte/) integrations can be used respectively
|
|
134
|
+
*/
|
|
42
135
|
NoMatchingRenderer: {
|
|
43
136
|
title: "No matching renderer found.",
|
|
44
137
|
code: 3007,
|
|
@@ -50,48 +143,175 @@ but ${plural ? "none were." : "it was not."} able to server-side render \`${comp
|
|
|
50
143
|
|
|
51
144
|
See https://docs.astro.build/en/core-concepts/framework-components/ for more information on how to install and configure integrations.`
|
|
52
145
|
},
|
|
146
|
+
/**
|
|
147
|
+
* @docs
|
|
148
|
+
* @see
|
|
149
|
+
* - [addRenderer option](https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option)
|
|
150
|
+
* - [Hydrating framework components](https://docs.astro.build/en/core-concepts/framework-components/#hydrating-interactive-components)
|
|
151
|
+
* @description
|
|
152
|
+
* Astro tried to hydrate a component on the client, but the renderer used does not provide a client entrypoint to use to hydrate.
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
53
155
|
NoClientEntrypoint: {
|
|
54
156
|
title: "No client entrypoint specified in renderer.",
|
|
55
157
|
code: 3008,
|
|
56
158
|
message: (componentName, clientDirective, rendererName) => `\`${componentName}\` component has a \`client:${clientDirective}\` directive, but no client entrypoint was provided by \`${rendererName}\`.`,
|
|
57
159
|
hint: "See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer."
|
|
58
160
|
},
|
|
161
|
+
/**
|
|
162
|
+
* @docs
|
|
163
|
+
* @see
|
|
164
|
+
* - [`client:only`](https://docs.astro.build/en/reference/directives-reference/#clientonly)
|
|
165
|
+
* @description
|
|
166
|
+
*
|
|
167
|
+
* `client:only` components are not run on the server, as such Astro does not know (and cannot guess) which renderer to use and require a hint. Like such:
|
|
168
|
+
*
|
|
169
|
+
* ```astro
|
|
170
|
+
* <SomeReactComponent client:only="react" />
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
59
173
|
NoClientOnlyHint: {
|
|
60
174
|
title: "Missing hint on client:only directive.",
|
|
61
175
|
code: 3009,
|
|
62
176
|
message: (componentName) => `Unable to render \`${componentName}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`,
|
|
63
177
|
hint: (probableRenderers) => `Did you mean to pass \`client:only="${probableRenderers}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on client:only`
|
|
64
178
|
},
|
|
179
|
+
/**
|
|
180
|
+
* @docs
|
|
181
|
+
* @see
|
|
182
|
+
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
183
|
+
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
|
|
184
|
+
* @description
|
|
185
|
+
* The `params` property in `getStaticPaths`'s return value (an array of objects) should also be an object.
|
|
186
|
+
*
|
|
187
|
+
* ```astro title="pages/blog/[id].astro"
|
|
188
|
+
* ---
|
|
189
|
+
* export async function getStaticPaths() {
|
|
190
|
+
* return [
|
|
191
|
+
* { params: { slug: "blog" } },
|
|
192
|
+
* { params: { slug: "about" } }
|
|
193
|
+
* ];
|
|
194
|
+
*}
|
|
195
|
+
*---
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
65
198
|
InvalidGetStaticPathParam: {
|
|
66
199
|
title: "Invalid value returned by a `getStaticPaths` path.",
|
|
67
200
|
code: 3010,
|
|
68
201
|
message: (paramType) => `Invalid params given to \`getStaticPaths\` path. Expected an \`object\`, got \`${paramType}\``,
|
|
69
202
|
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
70
203
|
},
|
|
204
|
+
/**
|
|
205
|
+
* @docs
|
|
206
|
+
* @see
|
|
207
|
+
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
208
|
+
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
|
|
209
|
+
* @description
|
|
210
|
+
* `getStaticPaths`'s return value must be an array of objects.
|
|
211
|
+
*
|
|
212
|
+
* ```ts title="pages/blog/[id].astro"
|
|
213
|
+
* export async function getStaticPaths() {
|
|
214
|
+
* return [ // <-- Array
|
|
215
|
+
* { params: { slug: "blog" } },
|
|
216
|
+
* { params: { slug: "about" } }
|
|
217
|
+
* ];
|
|
218
|
+
*}
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
71
221
|
InvalidGetStaticPathsReturn: {
|
|
72
222
|
title: "Invalid value returned by getStaticPaths.",
|
|
73
223
|
code: 3011,
|
|
74
224
|
message: (returnType) => `Invalid type returned by \`getStaticPaths\`. Expected an \`array\`, got \`${returnType}\``,
|
|
75
225
|
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
76
226
|
},
|
|
227
|
+
/**
|
|
228
|
+
* @docs
|
|
229
|
+
* @see
|
|
230
|
+
* - [RSS Guide](https://docs.astro.build/en/guides/rss/)
|
|
231
|
+
* @description
|
|
232
|
+
* `getStaticPaths` no longer expose an helper for generating a RSS feed. We recommend migrating to the [@astrojs/rss](https://docs.astro.build/en/guides/rss/#setting-up-astrojsrss)integration instead.
|
|
233
|
+
*/
|
|
77
234
|
GetStaticPathsRemovedRSSHelper: {
|
|
78
235
|
title: "getStaticPaths RSS helper is not available anymore.",
|
|
79
236
|
code: 3012,
|
|
80
237
|
message: "The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead.",
|
|
81
238
|
hint: "See https://docs.astro.build/en/guides/rss/ for more information."
|
|
82
239
|
},
|
|
240
|
+
/**
|
|
241
|
+
* @docs
|
|
242
|
+
* @see
|
|
243
|
+
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
244
|
+
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
|
|
245
|
+
* @description
|
|
246
|
+
* Every route specified by `getStaticPaths` require a `params` property specifying the path parameters needed to match the route.
|
|
247
|
+
*
|
|
248
|
+
* For instance, the following code:
|
|
249
|
+
* ```astro title="pages/blog/[id].astro"
|
|
250
|
+
* ---
|
|
251
|
+
* export async function getStaticPaths() {
|
|
252
|
+
* return [
|
|
253
|
+
* { params: { id: '1' } }
|
|
254
|
+
* ];
|
|
255
|
+
* }
|
|
256
|
+
* ---
|
|
257
|
+
* ```
|
|
258
|
+
* Will create the following route: `site.com/blog/1`.
|
|
259
|
+
*/
|
|
83
260
|
GetStaticPathsExpectedParams: {
|
|
84
261
|
title: "Missing params property on `getStaticPaths` route.",
|
|
85
262
|
code: 3013,
|
|
86
263
|
message: "Missing or empty required `params` property on `getStaticPaths` route.",
|
|
87
264
|
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
88
265
|
},
|
|
266
|
+
/**
|
|
267
|
+
* @docs
|
|
268
|
+
* @see
|
|
269
|
+
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
270
|
+
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
|
|
271
|
+
* @description
|
|
272
|
+
* Since `params` are encoded into the URL, only certain types are supported as values.
|
|
273
|
+
*
|
|
274
|
+
* ```astro title="/route/[id].astro"
|
|
275
|
+
* ---
|
|
276
|
+
* export async function getStaticPaths() {
|
|
277
|
+
* return [
|
|
278
|
+
* { params: { id: '1' } } // Works
|
|
279
|
+
* { params: { id: 2 } } // Works
|
|
280
|
+
* { params: { id: false } } // Does not work
|
|
281
|
+
* ];
|
|
282
|
+
* }
|
|
283
|
+
* ---
|
|
284
|
+
* ```
|
|
285
|
+
*
|
|
286
|
+
* In routes using [rest parameters](https://docs.astro.build/en/core-concepts/routing/#rest-parameters), `undefined` can be used to represent a path with no parameters passed in the URL:
|
|
287
|
+
*
|
|
288
|
+
* ```astro title="/route/[...id].astro"
|
|
289
|
+
* ---
|
|
290
|
+
* export async function getStaticPaths() {
|
|
291
|
+
* return [
|
|
292
|
+
* { params: { id: 1 } } // /route/1
|
|
293
|
+
* { params: { id: 2 } } // /route/2
|
|
294
|
+
* { params: { id: undefined } } // /route/
|
|
295
|
+
* ];
|
|
296
|
+
* }
|
|
297
|
+
* ---
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
89
300
|
GetStaticPathsInvalidRouteParam: {
|
|
90
301
|
title: "Invalid value for `getStaticPaths` route parameter.",
|
|
91
302
|
code: 3014,
|
|
92
303
|
message: (key, value, valueType) => `Invalid getStaticPaths route parameter for \`${key}\`. Expected undefined, a string or a number, received \`${valueType}\` (\`${value}\`)`,
|
|
93
304
|
hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."
|
|
94
305
|
},
|
|
306
|
+
/**
|
|
307
|
+
* @docs
|
|
308
|
+
* @see
|
|
309
|
+
* - [Dynamic Routes](https://docs.astro.build/en/core-concepts/routing/#dynamic-routes)
|
|
310
|
+
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
311
|
+
* - [Server-side Rendering](https://docs.astro.build/en/guides/server-side-rendering/)
|
|
312
|
+
* @description
|
|
313
|
+
* In [Static Mode](https://docs.astro.build/en/core-concepts/routing/#static-ssg-mode), all routes must be determined at build time. As such, dynamic routes must `export` a `getStaticPaths` function returning the different paths to generate.
|
|
314
|
+
*/
|
|
95
315
|
GetStaticPathsRequired: {
|
|
96
316
|
title: "`getStaticPaths()` function required for dynamic routes.",
|
|
97
317
|
code: 3015,
|
|
@@ -101,23 +321,51 @@ See https://docs.astro.build/en/core-concepts/framework-components/ for more inf
|
|
|
101
321
|
Alternatively, set \`output: "server"\` in your Astro config file to switch to a non-static server build. This error can also occur if using \`export const prerender = true;\`.
|
|
102
322
|
See https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.`
|
|
103
323
|
},
|
|
324
|
+
/**
|
|
325
|
+
* @docs
|
|
326
|
+
* @see
|
|
327
|
+
* - [Named slots](https://docs.astro.build/en/core-concepts/astro-components/#named-slots)
|
|
328
|
+
* @description
|
|
329
|
+
* Certain words cannot be used for slot names due to being already used internally.
|
|
330
|
+
*/
|
|
104
331
|
ReservedSlotName: {
|
|
105
332
|
title: "Invalid slot name.",
|
|
106
333
|
code: 3016,
|
|
107
334
|
message: (slotName) => `Unable to create a slot named \`${slotName}\`. \`${slotName}\` is a reserved slot name. Please update the name of this slot.`
|
|
108
335
|
},
|
|
336
|
+
/**
|
|
337
|
+
* @docs
|
|
338
|
+
* @see
|
|
339
|
+
* - [Server-side Rendering](https://docs.astro.build/en/guides/server-side-rendering/)
|
|
340
|
+
* - [Adding an Adapter](https://docs.astro.build/en/guides/server-side-rendering/#adding-an-adapter)
|
|
341
|
+
* @description
|
|
342
|
+
* To use server-side rendering, an adapter needs to be installed so Astro knows how to generate the proper output for your targeted deployment platform.
|
|
343
|
+
*/
|
|
109
344
|
NoAdapterInstalled: {
|
|
110
345
|
title: "Cannot use Server-side Rendering without an adapter.",
|
|
111
346
|
code: 3017,
|
|
112
347
|
message: `Cannot use \`output: 'server'\` without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
|
|
113
348
|
hint: "See https://docs.astro.build/en/guides/server-side-rendering/ for more information."
|
|
114
349
|
},
|
|
350
|
+
/**
|
|
351
|
+
* @docs
|
|
352
|
+
* @description
|
|
353
|
+
* No import statement was found for one of the components. If there is an import statement, make sure you are using the same identifier in both the imports and the component usage.
|
|
354
|
+
*/
|
|
115
355
|
NoMatchingImport: {
|
|
116
356
|
title: "No import found for component.",
|
|
117
357
|
code: 3018,
|
|
118
358
|
message: (componentName) => `Could not render \`${componentName}\`. No matching import has been found for \`${componentName}\`.`,
|
|
119
359
|
hint: "Please make sure the component is properly imported."
|
|
120
360
|
},
|
|
361
|
+
/**
|
|
362
|
+
* @docs
|
|
363
|
+
* @message
|
|
364
|
+
* **Example error messages:**<br/>
|
|
365
|
+
* InvalidPrerenderExport: A `prerender` export has been detected, but its value cannot be statically analyzed.
|
|
366
|
+
* @description
|
|
367
|
+
* The `prerender` feature only supports a subset of valid JavaScript — be sure to use exactly `export const prerender = true` so that our compiler can detect this directive at build time. Variables, `let`, and `var` declarations are not supported.
|
|
368
|
+
*/
|
|
121
369
|
InvalidPrerenderExport: {
|
|
122
370
|
title: "Invalid prerender export.",
|
|
123
371
|
code: 3019,
|
|
@@ -133,35 +381,96 @@ Expected \`true\` value but got \`${suffix}\`.`;
|
|
|
133
381
|
},
|
|
134
382
|
hint: "Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`."
|
|
135
383
|
},
|
|
384
|
+
/**
|
|
385
|
+
* @docs
|
|
386
|
+
* @message
|
|
387
|
+
* **Example error messages:**<br/>
|
|
388
|
+
* InvalidComponentArgs: Invalid arguments passed to `<MyAstroComponent>` component.
|
|
389
|
+
* @description
|
|
390
|
+
* Astro components cannot be rendered manually via a function call, such as `Component()` or `{items.map(Component)}`. Prefer the component syntax `<Component />` or `{items.map(item => <Component {...item} />)}`.
|
|
391
|
+
*/
|
|
136
392
|
InvalidComponentArgs: {
|
|
137
393
|
title: "Invalid component arguments.",
|
|
138
394
|
code: 3020,
|
|
139
395
|
message: (name) => `Invalid arguments passed to${name ? ` <${name}>` : ""} component.`,
|
|
140
396
|
hint: "Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`."
|
|
141
397
|
},
|
|
398
|
+
/**
|
|
399
|
+
* @docs
|
|
400
|
+
* @see
|
|
401
|
+
* - [Pagination](https://docs.astro.build/en/core-concepts/routing/#pagination)
|
|
402
|
+
* @description
|
|
403
|
+
* The page number parameter was not found in your filepath.
|
|
404
|
+
*/
|
|
142
405
|
PageNumberParamNotFound: {
|
|
143
406
|
title: "Page number param not found.",
|
|
144
407
|
code: 3021,
|
|
145
408
|
message: (paramName) => `[paginate()] page number param \`${paramName}\` not found in your filepath.`,
|
|
146
409
|
hint: "Rename your file to `[page].astro` or `[...page].astro`."
|
|
147
410
|
},
|
|
411
|
+
/**
|
|
412
|
+
* @docs
|
|
413
|
+
* @see
|
|
414
|
+
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
|
|
415
|
+
* - [Image component](https://docs.astro.build/en/guides/assets/#image--astroassets)
|
|
416
|
+
* - [Image component#alt](https://docs.astro.build/en/guides/assets/#alt-required)
|
|
417
|
+
* @description
|
|
418
|
+
* The `alt` property allows you to provide descriptive alt text to users of screen readers and other assistive technologies. In order to ensure your images are accessible, the `Image` component requires that an `alt` be specified.
|
|
419
|
+
*
|
|
420
|
+
* If the image is merely decorative (i.e. doesn’t contribute to the understanding of the page), set `alt=""` so that screen readers know to ignore the image.
|
|
421
|
+
*/
|
|
148
422
|
ImageMissingAlt: {
|
|
149
423
|
title: "Missing alt property",
|
|
150
424
|
code: 3022,
|
|
151
425
|
message: "The alt property is required.",
|
|
152
426
|
hint: "The `alt` property is important for the purpose of accessibility, without it users using screen readers or other assistive technologies won't be able to understand what your image is supposed to represent. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt for more information."
|
|
153
427
|
},
|
|
428
|
+
/**
|
|
429
|
+
* @docs
|
|
430
|
+
* @see
|
|
431
|
+
* - [Image Service API](https://docs.astro.build/en/reference/image-service-reference/)
|
|
432
|
+
* @description
|
|
433
|
+
* There was an error while loading the configured image service. This can be caused by various factors, such as your image service not properly exporting a compatible object in its default export, or an incorrect path.
|
|
434
|
+
*
|
|
435
|
+
* If you believe that your service is properly configured and this error is wrong, please [open an issue](https://astro.build/issues/).
|
|
436
|
+
*/
|
|
154
437
|
InvalidImageService: {
|
|
155
438
|
title: "Error while loading image service",
|
|
156
439
|
code: 3023,
|
|
157
440
|
message: "There was an error loading the configured image service. Please see the stack trace for more information."
|
|
158
441
|
},
|
|
442
|
+
/**
|
|
443
|
+
* @docs
|
|
444
|
+
* @message
|
|
445
|
+
* Missing width and height attributes for `IMAGE_URL`. When using remote images, both dimensions are always required in order to avoid cumulative layout shift (CLS).
|
|
446
|
+
* @see
|
|
447
|
+
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
|
|
448
|
+
* - [Image component#width-and-height](https://docs.astro.build/en/guides/assets/#width-and-height)
|
|
449
|
+
* @description
|
|
450
|
+
* For remote images, `width` and `height` cannot be inferred from the original file. As such, in order to avoid CLS, those two properties are always required.
|
|
451
|
+
*
|
|
452
|
+
* If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets).
|
|
453
|
+
*/
|
|
159
454
|
MissingImageDimension: {
|
|
160
455
|
title: "Missing image dimensions",
|
|
161
456
|
code: 3024,
|
|
162
457
|
message: (missingDimension, imageURL) => `Missing ${missingDimension === "both" ? "width and height attributes" : `${missingDimension} attribute`} for ${imageURL}. When using remote images, both dimensions are always required in order to avoid CLS.`,
|
|
163
458
|
hint: "If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets)."
|
|
164
459
|
},
|
|
460
|
+
/**
|
|
461
|
+
* @docs
|
|
462
|
+
* @description
|
|
463
|
+
* The built-in image services do not currently support optimizing all image formats.
|
|
464
|
+
*
|
|
465
|
+
* For unsupported formats such as SVGs and GIFs, you may be able to use an `img` tag directly:
|
|
466
|
+
* ```astro
|
|
467
|
+
* ---
|
|
468
|
+
* import rocket from '../assets/images/rocket.svg'
|
|
469
|
+
* ---
|
|
470
|
+
*
|
|
471
|
+
* <img src={rocket.src} width={rocket.width} height={rocket.height} alt="A rocketship in space." />
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
165
474
|
UnsupportedImageFormat: {
|
|
166
475
|
title: "Unsupported image format",
|
|
167
476
|
code: 3025,
|
|
@@ -170,90 +479,257 @@ Expected \`true\` value but got \`${suffix}\`.`;
|
|
|
170
479
|
)} are supported for optimization.`,
|
|
171
480
|
hint: "If you do not need optimization, using an `img` tag directly instead of the `Image` component might be what you're looking for."
|
|
172
481
|
},
|
|
482
|
+
// No headings here, that way Vite errors are merged with Astro ones in the docs, which makes more sense to users.
|
|
483
|
+
// Vite Errors - 4xxx
|
|
484
|
+
/**
|
|
485
|
+
* @docs
|
|
486
|
+
* @see
|
|
487
|
+
* - [Vite troubleshooting guide](https://vitejs.dev/guide/troubleshooting.html)
|
|
488
|
+
* @description
|
|
489
|
+
* Vite encountered an unknown error while rendering your project. We unfortunately do not know what happened (or we would tell you!)
|
|
490
|
+
*
|
|
491
|
+
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
|
|
492
|
+
*/
|
|
173
493
|
UnknownViteError: {
|
|
174
494
|
title: "Unknown Vite Error.",
|
|
175
495
|
code: 4e3
|
|
176
496
|
},
|
|
497
|
+
/**
|
|
498
|
+
* @docs
|
|
499
|
+
* @see
|
|
500
|
+
* - [Type Imports](https://docs.astro.build/en/guides/typescript/#type-imports)
|
|
501
|
+
* @description
|
|
502
|
+
* Astro could not import the requested file. Oftentimes, this is caused by the import path being wrong (either because the file does not exist, or there is a typo in the path)
|
|
503
|
+
*
|
|
504
|
+
* This message can also appear when a type is imported without specifying that it is a [type import](https://docs.astro.build/en/guides/typescript/#type-imports).
|
|
505
|
+
*/
|
|
177
506
|
FailedToLoadModuleSSR: {
|
|
178
507
|
title: "Could not import file.",
|
|
179
508
|
code: 4001,
|
|
180
509
|
message: (importName) => `Could not import \`${importName}\`.`,
|
|
181
510
|
hint: "This is often caused by a typo in the import path. Please make sure the file exists."
|
|
182
511
|
},
|
|
512
|
+
/**
|
|
513
|
+
* @docs
|
|
514
|
+
* @see
|
|
515
|
+
* - [Glob Patterns](https://docs.astro.build/en/guides/imports/#glob-patterns)
|
|
516
|
+
* @description
|
|
517
|
+
* Astro encountered an invalid glob pattern. This is often caused by the glob pattern not being a valid file path.
|
|
518
|
+
*/
|
|
183
519
|
InvalidGlob: {
|
|
184
520
|
title: "Invalid glob pattern.",
|
|
185
521
|
code: 4002,
|
|
186
522
|
message: (globPattern) => `Invalid glob pattern: \`${globPattern}\`. Glob patterns must start with './', '../' or '/'.`,
|
|
187
523
|
hint: "See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns."
|
|
188
524
|
},
|
|
525
|
+
/**
|
|
526
|
+
* @docs
|
|
527
|
+
* @kind heading
|
|
528
|
+
* @name CSS Errors
|
|
529
|
+
*/
|
|
530
|
+
// CSS Errors - 5xxx
|
|
531
|
+
/**
|
|
532
|
+
* @docs
|
|
533
|
+
* @see
|
|
534
|
+
* - [Styles and CSS](https://docs.astro.build/en/guides/styling/)
|
|
535
|
+
* @description
|
|
536
|
+
* Astro encountered an unknown error while parsing your CSS. Oftentimes, this is caused by a syntax error and the error message should contain more information.
|
|
537
|
+
*/
|
|
189
538
|
UnknownCSSError: {
|
|
190
539
|
title: "Unknown CSS Error.",
|
|
191
540
|
code: 5e3
|
|
192
541
|
},
|
|
542
|
+
/**
|
|
543
|
+
* @docs
|
|
544
|
+
* @message
|
|
545
|
+
* **Example error messages:**<br/>
|
|
546
|
+
* CSSSyntaxError: Missed semicolon<br/>
|
|
547
|
+
* CSSSyntaxError: Unclosed string<br/>
|
|
548
|
+
* @description
|
|
549
|
+
* Astro encountered an error while parsing your CSS, due to a syntax error. This is often caused by a missing semicolon.
|
|
550
|
+
*/
|
|
193
551
|
CSSSyntaxError: {
|
|
194
552
|
title: "CSS Syntax Error.",
|
|
195
553
|
code: 5001
|
|
196
554
|
},
|
|
555
|
+
/**
|
|
556
|
+
* @docs
|
|
557
|
+
* @kind heading
|
|
558
|
+
* @name Markdown Errors
|
|
559
|
+
*/
|
|
560
|
+
// Markdown Errors - 6xxx
|
|
561
|
+
/**
|
|
562
|
+
* @docs
|
|
563
|
+
* @description
|
|
564
|
+
* Astro encountered an unknown error while parsing your Markdown. Oftentimes, this is caused by a syntax error and the error message should contain more information.
|
|
565
|
+
*/
|
|
197
566
|
UnknownMarkdownError: {
|
|
198
567
|
title: "Unknown Markdown Error.",
|
|
199
568
|
code: 6e3
|
|
200
569
|
},
|
|
570
|
+
/**
|
|
571
|
+
* @docs
|
|
572
|
+
* @message
|
|
573
|
+
* **Example error messages:**<br/>
|
|
574
|
+
* can not read an implicit mapping pair; a colon is missed<br/>
|
|
575
|
+
* unexpected end of the stream within a double quoted scalar<br/>
|
|
576
|
+
* can not read a block mapping entry; a multiline key may not be an implicit key
|
|
577
|
+
* @description
|
|
578
|
+
* Astro encountered an error while parsing the frontmatter of your Markdown file.
|
|
579
|
+
* This is often caused by a mistake in the syntax, such as a missing colon or a missing end quote.
|
|
580
|
+
*/
|
|
201
581
|
MarkdownFrontmatterParseError: {
|
|
202
582
|
title: "Failed to parse Markdown frontmatter.",
|
|
203
583
|
code: 6001
|
|
204
584
|
},
|
|
585
|
+
/**
|
|
586
|
+
* @docs
|
|
587
|
+
* @see
|
|
588
|
+
* - [Modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically)
|
|
589
|
+
* @description
|
|
590
|
+
* A remark or rehype plugin attempted to inject invalid frontmatter. This occurs when "astro.frontmatter" is set to `null`, `undefined`, or an invalid JSON object.
|
|
591
|
+
*/
|
|
205
592
|
InvalidFrontmatterInjectionError: {
|
|
206
593
|
title: "Invalid frontmatter injection.",
|
|
207
594
|
code: 6003,
|
|
208
595
|
message: 'A remark or rehype plugin attempted to inject invalid frontmatter. Ensure "astro.frontmatter" is set to a valid JSON object that is not `null` or `undefined`.',
|
|
209
596
|
hint: "See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information."
|
|
210
597
|
},
|
|
598
|
+
/**
|
|
599
|
+
* @docs
|
|
600
|
+
* @see
|
|
601
|
+
* - [MDX installation and usage](https://docs.astro.build/en/guides/integrations-guide/mdx/)
|
|
602
|
+
* @description
|
|
603
|
+
* Unable to find the official `@astrojs/mdx` integration. This error is raised when using MDX files without an MDX integration installed.
|
|
604
|
+
*/
|
|
211
605
|
MdxIntegrationMissingError: {
|
|
212
606
|
title: "MDX integration missing.",
|
|
213
607
|
code: 6004,
|
|
214
608
|
message: (file) => `Unable to render ${file}. Ensure that the \`@astrojs/mdx\` integration is installed.`,
|
|
215
609
|
hint: "See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/"
|
|
216
610
|
},
|
|
611
|
+
// Config Errors - 7xxx
|
|
612
|
+
/**
|
|
613
|
+
* @docs
|
|
614
|
+
* @see
|
|
615
|
+
* - [Configuration Reference](https://docs.astro.build/en/reference/configuration-reference/)
|
|
616
|
+
* @description
|
|
617
|
+
* Astro encountered an unknown error loading your Astro configuration file.
|
|
618
|
+
* This is often caused by a syntax error in your config and the message should offer more information.
|
|
619
|
+
*
|
|
620
|
+
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
|
|
621
|
+
*/
|
|
217
622
|
UnknownConfigError: {
|
|
218
623
|
title: "Unknown configuration error.",
|
|
219
624
|
code: 7e3
|
|
220
625
|
},
|
|
626
|
+
/**
|
|
627
|
+
* @docs
|
|
628
|
+
* @see
|
|
629
|
+
* - [--config](https://docs.astro.build/en/reference/cli-reference/#--config-path)
|
|
630
|
+
* @description
|
|
631
|
+
* The specified configuration file using `--config` could not be found. Make sure that it exists or that the path is correct
|
|
632
|
+
*/
|
|
221
633
|
ConfigNotFound: {
|
|
222
634
|
title: "Specified configuration file not found.",
|
|
223
635
|
code: 7001,
|
|
224
636
|
message: (configFile) => `Unable to resolve \`--config "${configFile}"\`. Does the file exist?`
|
|
225
637
|
},
|
|
638
|
+
/**
|
|
639
|
+
* @docs
|
|
640
|
+
* @see
|
|
641
|
+
* - [Configuration reference](https://docs.astro.build/en/reference/configuration-reference/)
|
|
642
|
+
* @description
|
|
643
|
+
* Astro detected a legacy configuration option in your configuration file.
|
|
644
|
+
*/
|
|
226
645
|
ConfigLegacyKey: {
|
|
227
646
|
title: "Legacy configuration detected.",
|
|
228
647
|
code: 7002,
|
|
229
648
|
message: (legacyConfigKey) => `Legacy configuration detected: \`${legacyConfigKey}\`.`,
|
|
230
649
|
hint: "Please update your configuration to the new format.\nSee https://astro.build/config for more information."
|
|
231
650
|
},
|
|
651
|
+
/**
|
|
652
|
+
* @docs
|
|
653
|
+
* @kind heading
|
|
654
|
+
* @name CLI Errors
|
|
655
|
+
*/
|
|
656
|
+
// CLI Errors - 8xxx
|
|
657
|
+
/**
|
|
658
|
+
* @docs
|
|
659
|
+
* @description
|
|
660
|
+
* Astro encountered an unknown error while starting one of its CLI commands. The error message should contain more information.
|
|
661
|
+
*
|
|
662
|
+
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
|
|
663
|
+
*/
|
|
232
664
|
UnknownCLIError: {
|
|
233
665
|
title: "Unknown CLI Error.",
|
|
234
666
|
code: 8e3
|
|
235
667
|
},
|
|
668
|
+
/**
|
|
669
|
+
* @docs
|
|
670
|
+
* @description
|
|
671
|
+
* `astro sync` command failed to generate content collection types.
|
|
672
|
+
* @see
|
|
673
|
+
* - [Content collections documentation](https://docs.astro.build/en/guides/content-collections/)
|
|
674
|
+
*/
|
|
236
675
|
GenerateContentTypesError: {
|
|
237
676
|
title: "Failed to generate content types.",
|
|
238
677
|
code: 8001,
|
|
239
678
|
message: "`astro sync` command failed to generate content collection types.",
|
|
240
679
|
hint: "Check your `src/content/config.*` file for typos."
|
|
241
680
|
},
|
|
681
|
+
/**
|
|
682
|
+
* @docs
|
|
683
|
+
* @kind heading
|
|
684
|
+
* @name Content Collection Errors
|
|
685
|
+
*/
|
|
686
|
+
// Content Collection Errors - 9xxx
|
|
687
|
+
/**
|
|
688
|
+
* @docs
|
|
689
|
+
* @description
|
|
690
|
+
* Astro encountered an unknown error loading your content collections.
|
|
691
|
+
* This can be caused by certain errors inside your `src/content/config.ts` file or some internal errors.
|
|
692
|
+
*
|
|
693
|
+
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
|
|
694
|
+
*/
|
|
242
695
|
UnknownContentCollectionError: {
|
|
243
696
|
title: "Unknown Content Collection Error.",
|
|
244
697
|
code: 9e3
|
|
245
698
|
},
|
|
699
|
+
/**
|
|
700
|
+
* @docs
|
|
701
|
+
* @message
|
|
702
|
+
* **Example error message:**<br/>
|
|
703
|
+
* **blog** → **post.md** frontmatter does not match collection schema.<br/>
|
|
704
|
+
* "title" is required.<br/>
|
|
705
|
+
* "date" must be a valid date.
|
|
706
|
+
* @description
|
|
707
|
+
* A Markdown or MDX entry in `src/content/` does not match its collection schema.
|
|
708
|
+
* Make sure that all required fields are present, and that all fields are of the correct type.
|
|
709
|
+
* You can check against the collection schema in your `src/content/config.*` file.
|
|
710
|
+
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
|
|
711
|
+
*/
|
|
246
712
|
InvalidContentEntryFrontmatterError: {
|
|
247
713
|
title: "Content entry frontmatter does not match schema.",
|
|
248
714
|
code: 9001,
|
|
249
715
|
message: (collection, entryId, error) => {
|
|
250
716
|
return [
|
|
251
|
-
|
|
717
|
+
`**${String(collection)} \u2192 ${String(
|
|
718
|
+
entryId
|
|
719
|
+
)}** frontmatter does not match collection schema.`,
|
|
252
720
|
...error.errors.map((zodError) => zodError.message)
|
|
253
721
|
].join("\n");
|
|
254
722
|
},
|
|
255
723
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
256
724
|
},
|
|
725
|
+
/**
|
|
726
|
+
* @docs
|
|
727
|
+
* @message `COLLECTION_NAME` → `ENTRY_ID` has an invalid slug. `slug` must be a string.
|
|
728
|
+
* @see
|
|
729
|
+
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/)
|
|
730
|
+
* @description
|
|
731
|
+
* An entry in `src/content/` has an invalid `slug`. This field is reserved for generating entry slugs, and must be a string when present.
|
|
732
|
+
*/
|
|
257
733
|
InvalidContentEntrySlugError: {
|
|
258
734
|
title: "Invalid content entry slug.",
|
|
259
735
|
code: 9002,
|
|
@@ -264,6 +740,14 @@ Expected \`true\` value but got \`${suffix}\`.`;
|
|
|
264
740
|
},
|
|
265
741
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
266
742
|
},
|
|
743
|
+
/**
|
|
744
|
+
* @docs
|
|
745
|
+
* @message A content collection schema should not contain `slug` since it is reserved for slug generation. Remove this from your `COLLECTION_NAME` collection schema.
|
|
746
|
+
* @see
|
|
747
|
+
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/)
|
|
748
|
+
* @description
|
|
749
|
+
* A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove the `slug` field from your schema, or choose a different name.
|
|
750
|
+
*/
|
|
267
751
|
ContentSchemaContainsSlugError: {
|
|
268
752
|
title: "Content Schema should not contain `slug`.",
|
|
269
753
|
code: 9003,
|
|
@@ -272,11 +756,12 @@ Expected \`true\` value but got \`${suffix}\`.`;
|
|
|
272
756
|
},
|
|
273
757
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
|
|
274
758
|
},
|
|
759
|
+
// Generic catch-all - Only use this in extreme cases, like if there was a cosmic ray bit flip
|
|
275
760
|
UnknownError: {
|
|
276
761
|
title: "Unknown Error.",
|
|
277
762
|
code: 99999
|
|
278
763
|
}
|
|
279
|
-
}
|
|
764
|
+
};
|
|
280
765
|
export {
|
|
281
766
|
AstroErrorData
|
|
282
767
|
};
|