docz: Playground component not rendering any content
Bug Report
Playground
component is not rendering any content.
To Reproduce
- Build and run this example https://github.com/doczjs/docz/tree/master/examples/basic
- Go to http://localhost:3000/src-components-alert
Expected behavior
Expect to see a preview of the Alert component
Environment
- docz version: latest
- OS: OSX 10.15.5
- Node/npm version: Node 10.16.3/npm 6.9.0
Additional context/Screenshots
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 11
- Comments: 15
@mhxbe, that’s awesome debugging and I can confirm your findings. I confirm that reinstalling clean doesn’t fix anything if we naturally run
npm install
, and this installs with@mdx-js/mdx@2.0.0-next.7
.A hotfix can be done by adding
"@mdx-js/mdx": "^1.6.16"
explicitly as a dev dependency.node_modules
,package-lock.json
"@mdx-js/mdx": "^1.6.16"
explicitly as a dev dependency.npm install
npm run docz dev
While this works, it’s a hack and the hotfix doesn’t really make sense even though it works because if you checked through the lockfile grepping for
mdx-js
, you’ll realize that:gatsby-interface
andremark-mdxjs
require@2.0.0-*
dependenciesdocz
itself seems to require@1.6*
dependencies.It seems that these maybe
gatsby
dependencies related. If the project maintainers can address the underlying dependencies so clean installs can work without needing knowledge of nested dependencies, that would be great!A colleague & myself were also struggling with empty Playgrounds. Here are our findings.
NPM (Error ❌ empty Playgrounds)
Yarn (Success ✅ )
Possible cause
We have inspected and compared some dependencies between the
npm
&yarn
install and I think the@mdx-js/mdx
-dependency is the culprit.1.6.16
2.0.0-next.7
We have tested the yarn-approach successfully on:
@mdx-js/mdx@1.6.16
whereas npm installed@mdx-js/mdx2.0.0-next.7
nor props, nor playground doesn’t work for me =(
MacOS: 10.15.6 (19G2021) NodeJS: v14.5.0 docz: ^2.3.1
Components are written on TypeScript
/docs/components/test.mdx:
/doczrc.js