Astro Info
Astro v7.0.6
Node v22+
System macOS / Linux
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/mdx
If this issue only occurs in one browser, which browser is a problem?
N/A (build / Node module resolution)
Describe the Bug
@astrojs/mdx statically imports satteri in its Sätteri MDX entrypoints, for example:
https://github.com/withastro/astro/blob/@astrojs/mdx@7.0.3/packages/integrations/mdx/src/satteri/index.ts
import {
mdxToJs,
// ...
} from 'satteri';
But packages/integrations/mdx/package.json does not list satteri in dependencies. It only declares optional peer @astrojs/markdown-satteri (which itself depends on satteri), and historically kept satteri in devDependencies only.
With pnpm's isolated node_modules and a normal Astro + MDX project (integrations: [mdx()] + an .mdx page):
- There is no
satteri symlink beside @astrojs/mdx
astro build often still succeeds by walking up to node_modules/.pnpm/node_modules/satteri
- When that link is missing,
astro build fails while compiling MDX:
[ERROR] [vite] ✗ Build failed
Cannot find package 'satteri' imported from
.../node_modules/@astrojs/mdx/dist/satteri/index.js
at .../@astrojs/mdx/dist/vite-plugin-mdx.js
Reproduced on @astrojs/mdx@7.0.3. main still omits satteri from @astrojs/mdx dependencies.
Related: #17072 addressed optional Sätteri loading for the Container API path, but does not declare satteri for the default Sätteri MDX processor path used when @astrojs/markdown-satteri is present (pulled in by astro itself on Astro 7).
What's the expected result?
astro build on an MDX page should succeed under pnpm without relying on an accidental .pnpm/node_modules/satteri link. satteri should be a declared dependency of @astrojs/mdx so pnpm links it into @astrojs/mdx's isolated node_modules.
Link to Minimal Reproducible Example
https://github.com/grant/astro-mdx-satteri-undeclared-dep-repro
Minimal Astro project with:
astro.config.mjs → integrations: [mdx()]
src/pages/post.mdx → MDX page compiled during astro build
pnpm repro runs a real astro build twice:
- With
.pnpm/node_modules/satteri present → build succeeds
- After temporarily removing that link →
astro build fails with Cannot find package 'satteri' from @astrojs/mdx/dist/satteri/index.js
Manual steps are also in the README.
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
N/A (build / Node module resolution)
Describe the Bug
@astrojs/mdxstatically importssatteriin its Sätteri MDX entrypoints, for example:https://github.com/withastro/astro/blob/@astrojs/mdx@7.0.3/packages/integrations/mdx/src/satteri/index.ts
But
packages/integrations/mdx/package.jsondoes not listsatteriindependencies. It only declares optional peer@astrojs/markdown-satteri(which itself depends onsatteri), and historically keptsatteriindevDependenciesonly.With pnpm's isolated
node_modulesand a normal Astro + MDX project (integrations: [mdx()]+ an.mdxpage):satterisymlink beside@astrojs/mdxastro buildoften still succeeds by walking up tonode_modules/.pnpm/node_modules/satteriastro buildfails while compiling MDX:Reproduced on
@astrojs/mdx@7.0.3.mainstill omitssatterifrom@astrojs/mdxdependencies.Related: #17072 addressed optional Sätteri loading for the Container API path, but does not declare
satterifor the default Sätteri MDX processor path used when@astrojs/markdown-satteriis present (pulled in byastroitself on Astro 7).What's the expected result?
astro buildon an MDX page should succeed under pnpm without relying on an accidental.pnpm/node_modules/satterilink.satterishould be a declareddependencyof@astrojs/mdxso pnpm links it into@astrojs/mdx's isolatednode_modules.Link to Minimal Reproducible Example
https://github.com/grant/astro-mdx-satteri-undeclared-dep-repro
Minimal Astro project with:
astro.config.mjs→integrations: [mdx()]src/pages/post.mdx→ MDX page compiled duringastro buildpnpm reproruns a realastro buildtwice:.pnpm/node_modules/satteripresent → build succeedsastro buildfails withCannot find package 'satteri'from@astrojs/mdx/dist/satteri/index.jsManual steps are also in the README.
Participation