markdoc
markdoc copied to clipboard
Investigate 'document is undefined' errors and other breakages during sub-compilation in @markdoc/next.js
What happened?
When validating the markdoc schema, we now hit an error from Next.js where document
is undefined when sub-compiling: https://github.com/markdoc/next.js/blob/main/src/loader.js#L79-L88
To reproduce
- Clone and install https://github.com/markdoc/markdoc-starter
-
npm link
https://github.com/markdoc/markdoc-starter with https://github.com/markdoc/next.js -
console.log(error)
here: https://github.com/markdoc/next.js/blob/main/src/loader.js#L85 - Notice
document is undefined
error
Version
0.1.8 (0.1.7 @markdoc/next.js
)
also in
next
: 12.3.1
@markdoc/next.js
: 0.1.8
Additional context
No response