-
-
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
Prevent usage of astro:content in the client #11827
Conversation
🦋 Changeset detectedLatest commit: 5747564 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a major
changeset. A reviewer will merge this at the next release if approved.
@@ -360,7 +372,7 @@ export async function generateLookupMap({ | |||
const contentEntryType = contentEntryConfigByExt.get(extname(filePath)); | |||
if (!contentEntryType) throw UnexpectedLookupMapError; | |||
|
|||
const { id, slug: generatedSlug } = await getContentEntryIdAndSlug({ | |||
const { id, slug: generatedSlug } = getContentEntryIdAndSlug({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an unrelated change, but this await
is on a sync function, so I removed.
Co-authored-by: Emanuele Stoppa <[email protected]>
if(isClient) { | ||
// Empty exports is probably enough to break the build. | ||
// If for some reason its being imported as a side-effect ala `import 'astro:content';` then throw an error message. | ||
virtualModContents = `export {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed? I think for astro:env
I just throw without returning any content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, removed
…ro into no-astro-content-in-client
Changes
Testing
Docs