You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v4.8.4
Node v20.12.0
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/node
Integrations @astrojs/mdx
@astrojs/sitemap
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When adding multiple imported components in MDX files inside content collections, only one Component will retain its script in the build process.
MDX files rendered in content collections DO NOT have all scripts bundled in build
Only the last component in the MDX file has its script bundled successfully
Reproduction
Create a content collection with MDX files, and import more than one Component which have client-side scripts
Build and Preview
Only one script from the components will be in the build and imported on the rendered page
What's the expected result?
Using multiple imported components with client side <script> should all have the scripts available in the build.
Currently this works in dev, but not in a built/deployed project.
Additionally, MDX files as pages in the pages directory DO successfully retain all scripts in the build. So this would appear to be specifically to the content collections.
Hello Thomas, just saw your issue which I duplicated without knowing (#1883), and wrongly attributed to the @astrojs/starlight repo...
The only thing I can add to your description is that I believe the issue to only occur with versions 4.8.0 and higher of Astro.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When adding multiple imported components in MDX files inside content collections, only one Component will retain its script in the build process.
Reproduction
What's the expected result?
Using multiple imported components with client side <script> should all have the scripts available in the build.
Currently this works in dev, but not in a built/deployed project.
Additionally, MDX files as pages in the pages directory DO successfully retain all scripts in the build. So this would appear to be specifically to the content collections.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-u2ucn6?file=src%2Fpages%2Fstatic-page.mdx
Participation
The text was updated successfully, but these errors were encountered: