Back to Withastro

Astro.glob() used outside of an Astro file.

src/content/docs/en/reference/errors/astro-glob-used-outside.mdx

latest554 B
Original Source

import DontEditWarning from '~/components/DontEditWarning.astro'

<DontEditWarning />

:::caution[Deprecated] This error was removed in Astro v6.0.0 along with the removal of Astro.glob(). :::

AstroGlobUsedOutside: Astro.glob(GLOB_STR) can only be used in .astro files. import.meta.glob(GLOB_STR) can be used instead to achieve a similar result.

What went wrong?

Astro.glob() can only be used in .astro files. You can use import.meta.glob() instead to achieve the same result.