fix(mdx): resolve React-PDF SVG typings and next-mdx-remote parsing issues for pages/products
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 52s
Build & Deploy / 🏗️ Build (push) Successful in 1m58s
Build & Deploy / 🚀 Deploy (push) Failing after 14s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s

This commit is contained in:
2026-06-09 19:21:22 +02:00
parent 5a9c6e4a0a
commit 3cbb4ba700
4 changed files with 16 additions and 3 deletions

1
.data/leads-backup.jsonl Normal file
View File

@@ -0,0 +1 @@
{"timestamp":"2026-06-09T17:18:52.824Z","name":"John Doe","email":"john@example.com","productName":null,"message":"Hello, this is a test message."}\n{"timestamp":"2026-06-09T17:18:52.855Z","name":"Tester","email":"testing@mintel.me","productName":null,"message":"Test"}\n{"timestamp":"2026-06-09T17:20:50.586Z","name":"John Doe","email":"john@example.com","productName":null,"message":"Hello, this is a test message."}\n{"timestamp":"2026-06-09T17:20:50.613Z","name":"Tester","email":"testing@mintel.me","productName":null,"message":"Test"}\n

View File

@@ -51,7 +51,13 @@ export async function getPageBySlug(slug: string, locale: string): Promise<PageD
const fileContent = await fs.readFile(filePath, 'utf-8');
const { data, content } = matter(fileContent);
let parsedContent = content;
// Fix MDX data props dropped by next-mdx-remote
// Payload serializes as data={{"items":...}} which Acorn treats as a Block statement.
const fixedContent = content.replace(/data=\{\{([\s\S]*?)\}\}/g, (match, p1) => {
return 'data="{' + p1.replace(/"/g, '&quot;') + '}"';
});
let parsedContent = fixedContent;
try {
if (content.trim().startsWith('{')) {
parsedContent = JSON.parse(content);

View File

@@ -316,7 +316,7 @@ const parseSvgPaths = (filePath: string) => {
const VectorLogo = ({ paths, style }: { paths: { d: string; fill: string }[]; style: any }) => (
<Svg viewBox="0 0 295 99" style={style}>
<G fillRule="evenodd" clipRule="evenodd">
<G>
{paths.map((p, i) => (
<Path key={i} d={p.d} fill={p.fill} />
))}

View File

@@ -39,7 +39,13 @@ export async function getProductBySlug(slug: string, locale: string): Promise<Pr
const fileContent = await fs.readFile(filePath, 'utf-8');
const { data, content } = matter(fileContent);
let parsedContent = content;
// Fix MDX data props dropped by next-mdx-remote
// Payload serializes as data={{"items":...}} which Acorn treats as a Block statement.
const fixedContent = content.replace(/data=\{\{([\s\S]*?)\}\}/g, (match, p1) => {
return 'data="{' + p1.replace(/"/g, '&quot;') + '}"';
});
let parsedContent = fixedContent;
try {
if (content.trim().startsWith('{')) {
parsedContent = JSON.parse(content);