Skip to content

Content collections build: "Vite module runner has been closed." #12689

Description

@crummy

Astro Info

Astro                    v5.0.3
Node                     v23.2.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

Describe the Bug

I read files to generate a content collection. Works fine during development, but fails during build with this output:

❯ astro build
17:09:47 [content] Syncing content
17:09:47 [content] Content config changed
17:09:47 [content] Clearing content store
Vite module runner has been closed.
  Location:
    /home/projects/withastro-astro-7t9i3ppv/node_modules/vite/dist/node/module-runner.js:1217:13
  Stack trace:
    at SSRCompatModuleRunner.getModuleInformation (file:///home/projects/withastro-astro-7t9i3ppv/node_modules/vite/dist/node/module-runner.js:1217:13)
    at request (file:///home/projects/withastro-astro-7t9i3ppv/node_modules/vite/dist/node/module-runner.js:1243:99)
    at ./examples/csv/grammar.txt (/home/projects/withastro-astro-7t9i3ppv/src/content.config.ts:7:89)
    at eval (file:///home/projects/withastro-astro-7t9i3ppv/node_modules/zod/lib/index.mjs:3492:40)
    at eval (file:///home/projects/withastro-astro-7t9i3ppv/node_modules/astro/dist/content/content-layer.js:188:18)

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

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions