Astro Notes
JSON import type errors
When we do:
import mpps from "../../../content/members/documents/pps-myan/pps-myan.json";
import epps from "../../../content/members/documents/pps-eng/pps-eng.json";VSCode/TS will show red underlines because:
- By default, TypeScript doesn’t always know how to type
*.jsonimports. - Unless you have
"resolveJsonModule": truein yourtsconfig.json, VSCode/TS will complain (red underline), even though Astro’s bundler (Vite) will run it fine.
Fix:
{
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true
}
}Combining Layouts, Astro and Md
You may want unify them into a single layout by detecting whether the props come from *.astro, an astro page or *.md, a Markdown/MDX page.

