Repository navigation
Closed
Labels
triage: unable to reproduceTriage bot attempted reproduction but could not reproduce
Description
Astro Info
Astro v7.3.1
Node v26.4.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/sitemap
@astrojs/mdx
astro-icon
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
This looks like another occurence of #17898 and #17897, but after the fix added in #17899:
[GenerateContentTypesError] `astro sync` command failed to generate content collection types: "./mdx" is not exported under the conditions ["module", "node", "production", "astro", "import"] from package node_modules/@astrojs/internal-helpers (see exports field in node_modules/@astrojs/internal-helpers/package.json).
Hint:
This error is often caused by a syntax error inside your content, or your content configuration file. Check your src/content.config.ts file for typos.
Error reference:
https://docs.astro.build/en/reference/errors/generate-content-types-error/
Stack trace:
at syncContentCollections (file://node_modules/.pnpm/astro@7.3.1_@emnapi+core@1.11.1_@emnapi+runtime@1.11.3_@types+node@24.13.3_jiti@2.7.0_yaml@2.9.0/node_modules/astro/dist/core/sync/index.js:256:11)
at async AstroBuilder.setup (file://node_modules/.pnpm/astro@7.3.1_@emnapi+core@1.11.1_@emnapi+runtime@1.11.3_@types+node@24.13.3_jiti@2.7.0_yaml@2.9.0/node_modules/astro/dist/core/build/index.js:109:7)
at async build (file://node_modules/.pnpm/astro@7.3.1_@emnapi+core@1.11.1_@emnapi+runtime@1.11.3_@types+node@24.13.3_jiti@2.7.0_yaml@2.9.0/node_modules/astro/dist/core/build/index.js:50:3)
at async runCommand (file://node_modules/.pnpm/astro@7.3.1_@emnapi+core@1.11.1_@emnapi+runtime@1.11.3_@types+node@24.13.3_jiti@2.7.0_yaml@2.9.0/node_modules/astro/dist/cli/index.js:192:7)
Caused by:
"./mdx" is not exported under the conditions ["module", "node", "production", "astro", "import"] from package node_modules/@astrojs/internal-helpers (see exports field in node_modules/@astrojs/internal-helpers/package.json)
at async EnvironmentPluginContainer.resolveId (file://node_modules/.pnpm/vite@8.2.2_@types+node@24.13.3_esbuild@0.28.2_jiti@2.7.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:30848:19)
at async EnvironmentPluginContainer.resolveId (file://node_modules/.pnpm/vite@8.2.2_@types+node@24.13.3_esbuild@0.28.2_jiti@2.7.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:30848:19)
at async normalizeUrl (file://node_modules/.pnpm/vite@8.2.2_@types+node@24.13.3_esbuild@0.28.2_jiti@2.7.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:28075:22)
at async Promise.all (index 4)
at async EnvironmentPluginContainer.transform (file://node_modules/.pnpm/vite@8.2.2_@types+node@24.13.3_esbuild@0.28.2_jiti@2.7.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:30932:14)
What's the expected result?
No issue like it was with astro 7.2.9.
Link to Minimal Reproducible Example
Not yet, I failed to create a minimal reproducer there.
Participation
- I am willing to submit a pull request for this issue.
Metadata
Metadata
Assignees
Labels
triage: unable to reproduceTriage bot attempted reproduction but could not reproduce
Activity
astro-factory commentedon Sep 7, 2026
Triage complete
triage: unable to reproduceThe reported error (
"./mdx" is not exported ... from package node_modules/@astrojs/internal-helpers) points toastro@7.3.1'sdist/core/viteUtils.js, which imports@astrojs/internal-helpers/mdx. This subpath was added in@astrojs/internal-helpers@0.11.0(released withastro@7.2.10), andastro@7.3.1correctly declares a dependency on@astrojs/internal-helpers@0.11.0— which has the"./mdx"export. I tested with both the correct package versions (astro@7.3.1+@astrojs/mdx@8.0.0) and a version-mismatched scenario (astro@7.3.1+@astrojs/mdx@7.0.8); bothastro syncandastro buildsucceeded without error.I was unable to determine the cause of this issue. The most likely explanations are: (1) a stale
node_modulesor lockfile causing an older@astrojs/internal-helpers(0.10.x, which lacks the./mdxexport) to be resolved at runtime, (2) a Node v26-specific module resolution behavior (we tested on Node v22), or (3) a pnpm deduplication/hoisting quirk specific to the reporter's dependency tree. Deletingnode_modulesandpnpm-lock.yamland reinstalling may resolve this.Full Triage Report
Issue Summary
Title: astro 7.3.1: astrojs/mdx with internal path issue
Reporter says: After upgrading to astro 7.3.1 (from 7.2.9), they get an error during
astro sync/astro build:The error occurs in
syncContentCollections→ Vite'sEnvironmentPluginContainer.transform→normalizeUrl→resolveIdchain.Environment:
@astrojs/sitemap,@astrojs/mdx,astro-iconRelated issues: #17898, #17897, #17899 (similar export resolution issues, #17899 was a fix for a related
astro/_internal/loggerexport issue)Reproduction Attempts
What was tried
Published packages with correct versions (
astro@7.3.1+@astrojs/mdx@8.0.0):astro syncandastro buildPublished packages with version mismatch (
astro@7.3.1+@astrojs/mdx@7.0.8):@astrojs/internal-helpers@0.10.4and@astrojs/internal-helpers@0.11.0were installed side-by-sideastro syncandastro buildWorkspace (HEAD) versions:
workspace:*dependencies in the monorepoAnalysis of the codebase
The
./mdxexport in@astrojs/internal-helperswas added in PR #17262 (commit f8e9458), released as@astrojs/internal-helpers@0.11.0alongsideastro@7.2.10and@astrojs/mdx@8.0.0.The import chain:
packages/astro/src/core/viteUtils.tshasexport { resolvePath } from '@astrojs/internal-helpers/mdx'astro/dist/core/viteUtils.jswhich is shipped in the publishedastro@7.3.1astro@7.3.1declares a dependency on@astrojs/internal-helpers@0.11.0(theworkspace:*resolves to this during publish)@astrojs/internal-helpers@0.11.0on npm correctly has"./mdx": "./dist/mdx.js"in its exports mapThe error occurs during Vite's
transform→normalizeUrl→resolveIdchain, meaning Vite is processing some module that containsimport ... from '@astrojs/internal-helpers/mdx'and failing to resolve it.Possible causes (not confirmed)
@astrojs/internal-helpers@0.10.xfrom a previous install that doesn't have the./mdxexportastro-iconand potentially other packages that could affect dependency resolutionConclusion
Not reproducible. The issue could not be reproduced with the published packages on Node v22 with pnpm v10.34.5. The reporter also could not create a minimal reproduction. The exported subpath
./mdxcorrectly exists in@astrojs/internal-helpers@0.11.0(the version thatastro@7.3.1depends on).This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
mahlzahn commentedon Sep 7, 2026
Additional info:
Deleting
node_modulesandpnpm-lock.yamland reinstalling and recreating locks did not help.a) Same happens with Node v24.19.0, b) it didn’t happen with astro v7.2.9
Same as (1).
astro-factory commentedon Sep 7, 2026
Triage complete
triage: unable to reproduceThe reported error (
"./mdx" is not exported ... from package @astrojs/internal-helpers) points to@astrojs/internal-helpers/mdx, a subpath export added in@astrojs/internal-helpers@0.11.0(released withastro@7.2.10). Bothastro@7.3.1and@astrojs/mdx@8.0.0correctly depend on@astrojs/internal-helpers@0.11.0, which includes the./mdxexport. We tested three scenarios — workspace (HEAD), published packages with npm, and published packages with pnpm includingastro-icon— andastro sync/astro buildsucceeded in all cases.I was unable to determine the cause of this issue. The most likely explanation is a dependency resolution issue specific to the reporter's project. The stack trace path (
/workspace/forgejo/website/node_modules/...) suggests a monorepo or workspace setup that may cause pnpm to resolve an older@astrojs/internal-helpers@0.10.x(which lacks the./mdxexport) instead of0.11.0. To help us investigate further, could you:cat node_modules/@astrojs/internal-helpers/package.json | grep version(or the equivalent path in your pnpm store) to confirm which version is being resolved?pnpm-lock.yamlshowing how@astrojs/internal-helpersis resolved?package.json+pnpm-lock.yamlthat triggers the issue would be very helpful.Full Triage Report
Issue Summary
Title: astro 7.3.1: astrojs/mdx with internal path issue
Reporter: @mahlzahn
Description: After upgrading to astro 7.3.1 (and also 7.2.10) from 7.2.9,
astro syncandastro buildfail with:The error occurs in
syncContentCollections→ Vite'sEnvironmentPluginContainer.transform→normalizeUrl→resolveIdchain.Environment (from reporter):
Related issues: #17898, #17897, #17899
Root Cause Analysis
The
./mdxexport was added to@astrojs/internal-helpersin version0.11.0, released alongsideastro@7.2.10. The previous version@astrojs/internal-helpers@0.10.4does not have the./mdxexport. If the wrong version were resolved at runtime, this error would occur.In all testing, the correct version (0.11.0) was resolved and the export worked correctly.
Reproduction Attempts
Attempt 1: Workspace (HEAD) packages
workspace:*deps for astro, @astrojs/mdx, @astrojs/sitemapastro syncsucceededastro buildsucceededAttempt 2: Published packages with npm
astro@7.3.1,@astrojs/mdx@^8.0.0,@astrojs/sitemap@^3.7.0@astrojs/internal-helpers@0.11.0was installed with./mdxexport presentastro syncandastro buildboth succeededAttempt 3: Published packages with pnpm + astro-icon
@astrojs/internal-helpers@0.11.0was in the pnpm store with./mdxexportastro syncandastro buildboth succeededConclusion
The issue could not be reproduced. Possible explanations:
@astrojs/internal-helpers@0.10.4(without./mdx) to be resolved instead of0.11.0/workspace/forgejo/website/)This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
mahlzahn commentedon Sep 7, 2026
That was the reason, mdx itself was not updated to latest version, yet.