-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content collections build: "Vite module runner has been closed." #12689
Comments
Ran into this issue updating an old website of mine, if an additional reproduction is needed: Princesseuh/astro-issues#1 Note that I do not use content collections |
It happens to me any time I import a file in a collection. Here's the smallest repro I've come up with: export const examples = defineCollection({
loader: async () => {
const file = await import('/src/examples/csv/grammar.txt');
return [];
},
}); Commenting out |
On your repo I replaced this line: const allStats = import.meta.glob("/src/data/*.json"); With this line: const allStats = {} And the error disappeared (it was replaced with a later error but presumably that's because this object is not expected to be empty). I wondered if dynamic imports were broken entirely but I put this at the top of an astro file and it worked fine: const f = await import("/src/examples/csv/grammar.txt?raw") |
Simplifies content collection parsing, and there's this: withastro/astro#12689
can also confirm that this issue is happening with the following vite dynamic import functions from an integration hook ( const mod = await import(configPath) |
Maybe same as vitejs/vite#18962 |
I have a workaround, reading files with
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This issue is still present in [email protected]. |
Astro Info
Describe the Bug
I read files to generate a content collection. Works fine during development, but fails during build with this output:
What's the expected result?
Should behave identically to dev.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-7t9i3ppv?file=src%2Fcontent.config.ts
In the console, run
astro build
.Participation
The text was updated successfully, but these errors were encountered: