You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error occurred prerendering page "/docs/connect-cpp". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Where the name property is undefined, which results in us being unable to resolve to the proper component.
I have been unable to see where this happens.
If I take the default transform function for fence node and add it to my fence defintion, this fixes the error (but breaks the rendering of my component)
To reproduce
I don't have a minimal reproduce yet....
Version
0.2.1
Additional context
This is using a custom integration, but it is a pretty straight forward in it's usage of transforms and react
The text was updated successfully, but these errors were encountered:
My markdown config object was, in some cases, being modified and malformed during processing.
Specifically, I am re-using some of the functionality of @markdoc/next.js which expects the render field to be a function to render a component instead of a string, so my config object was getting modified.
While this bug was my own, it was difficult to track down and I think it might be nice for Markdoc to do some more input validation.
Specifically, I think validating the markdoc config object might make it easier to catch bugs in usage as it is a non-trivial object to build.
I will keep this open to let you decide how you want to handle that.
Hey @addisonj — makes sense. You can validate the Markdoc config object by using the Config type exported from @markdoc/markdoc.
Going to close this issue since you resolved your case, but @rpaul-stripe we should consider potentially adding some warning message to the React renderer when in development.
What happened?
When using a custom
Fence
node with a definition of:And a (simplified) component being passed like:
Where component library has a component like:
Can result an AST representation like:
And an output node of
This results in an error in an error:
I have traced this down to https://github.com/markdoc/markdoc/blob/main/src/renderers/react/react.ts#L53
Where the name property is undefined, which results in us being unable to resolve to the proper component.
I have been unable to see where this happens.
If I take the default
transform
function forfence
node and add it to my fence defintion, this fixes the error (but breaks the rendering of my component)To reproduce
I don't have a minimal reproduce yet....
Version
0.2.1
Additional context
This is using a custom integration, but it is a pretty straight forward in it's usage of transforms and react
The text was updated successfully, but these errors were encountered: