markdoc icon indicating copy to clipboard operation
markdoc copied to clipboard

Investigate 'document is undefined' errors and other breakages during sub-compilation in @markdoc/next.js

Open mfix-stripe opened this issue 2 years ago • 0 comments

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

  1. Clone and install https://github.com/markdoc/markdoc-starter
  2. npm link https://github.com/markdoc/markdoc-starter with https://github.com/markdoc/next.js
  3. console.log(error) here: https://github.com/markdoc/next.js/blob/main/src/loader.js#L85
  4. 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

mfix-stripe avatar Sep 20 '22 22:09 mfix-stripe