-
-
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
Script cannot be detected as server or static mode on Astro v5.x #12609
Comments
Hello @cworld1. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Well! Here's the minimal reproduction: |
Error: The "astro:content" module is only available server-side. Error info on AstroError:
Error info on build (currently on Vercel, and locally deploy is the same):
|
same |
@Jazee6 A temporary solution is split out the utility scripts to another file, like |
facing the same issue, but I'm unable to pin down the exact issue and/or how to split the utilities file into two as suggested above. The issue came up after trying to upgrade to v5 and merging some changes from an upstream repo. |
I also get this error after migrating to Astro 5. |
Same error here after migrating to Astro 5.
|
@bluwy It is a known issue and should not be closed without an official solution. Can u consider it again? So many developers faced the same problem.🙏 |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Firefox
Describe the Bug
For file
src/utils.ts
but when component S inserted in dynamic server page P, astro seems cannot split out scripts and shows warnings.
What's the expected result?
When component S inserted in dynamic server page P, astro can work well.
Link to Minimal Reproducible Example
https://github.com/cworld1/astro-blog-test/tree/utils
Participation
The text was updated successfully, but these errors were encountered: