Conversation
Deploying redwood-sdk-docs with
|
| Latest commit: |
a907e1a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9caa2163.redwood-sdk-docs.pages.dev |
| Branch Preview URL: | https://content-collections-delete-b.redwood-sdk-docs.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Vite plugins that generate code at build time, such as
Content Collections, typically use thebuildStarthook to perform their work. The framework's directive scan, which is necessary to configure the main build, was running before this hook. This created a lifecycle mismatch: the directive scan attempts to resolve modules that are generated by these plugins. Because the scan ran before the plugins'buildStarthooks, the generated files had not been created yet. This causes the build to fail with a module resolution error, such asERROR: Cannot read file ".content-collections/generated": is a directory.Solution
This change introduces a "plugin setup pass" - a minimal, no-op Vite build that runs before the directive scan.
This pass is configured to be inert: it uses a temporary, empty file as an entry point and is set not to write any output. Its sole purpose is to trigger the
buildStarthook for all configured plugins, ensuring that any necessary code generation is complete before the directive scan begins.