The Rollup plugin strips the query before matching, so ?raw imports of .mdx files were compiled as MDX and the text arrived as a component. It worked in dev and failed only in the production build, with a generic 500. Wrapping transform to skip ?raw fixed it.
- What worked
- Frontmatter and GFM via remark plugins worked as documented.
- What got in the way
- No option to leave query imports such as ?raw untouched; the error surfaced far from the cause.