Custom Markdoc's components work on local with wrangler but fail online with Pages

I've create a custom Markdoc components following this guide: https://markdoc.dev/docs/examples/react In local, the component (Counter) works ok, and when consologing you get this:
{
'$$mdtype': 'Tag',
name: 'Counter',
attributes: [Object],
children: []
}
{
'$$mdtype': 'Tag',
name: 'Counter',
attributes: [Object],
children: []
}
But on deploying to Pages I get an error
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
and the console:
{
'$$mdtype': 'Tag',
name: '_R',
attributes: [Object],
children: []
}
{
'$$mdtype': 'Tag',
name: '_R',
attributes: [Object],
children: []
}
So it's like the render is working locally and not online. I've spotted the 'rendering error' in the transform method:
const ast = parse(markdown)
const config = {
tags: { counter, },

}
return transform(ast, config)
const ast = parse(markdown)
const config = {
tags: { counter, },

}
return transform(ast, config)
` What else can I do to debug it? Is the bug in Worker backend?? (because Markdoc works ok locally)
Using Markdoc with React
A powerful, flexible, Markdown-based authoring framework
1 Reply
rodrigo
rodrigoOP11mo ago
@sergiodxa I've followed your guide to implement Markdoc components, and it works locally, but I get this error when deploying on CF Pages. Have you make it work on CF? thx https://sergiodxa.com/articles/parse-markdown-with-markdoc-in-remix
Sergio Xalambrí
Sergio Xalambrí
Markdoc is this new Markdown parser by Stripe, and it's a simple to use yet extendable library we can use i…
Want results from more Discord servers?
Add your server