doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.55k stars 1.46k forks source link

Images not loading in Gatsby v3 #1659

Closed fostimus closed 2 years ago

fostimus commented 2 years ago

Bug Report

Describe the bug

Images in mdx don't load when migrating to Gatsby V3

To Reproduce

  1. Have an existing docz powered site with images
  2. Upgrade to Gatsby 3.x
  3. Images don't load
![alt text shows](./but-i-do-not.png)

Expected behavior

Images load

Environment

Additional context/Screenshots Dev tools looks like the image is loaded by webpack, and then put as the src of an image tag. Is there some way to just use the image loaded by webpack?

Screen Shot 2021-10-02 at 7 34 26 PM Screen Shot 2021-10-02 at 7 32 04 PM
fostimus commented 2 years ago

For anyone coming here for help: the problem is that the default export is no longer being imported. There needs to be an update to how remark-docz processes the markdown so webpack can properly handle the image.

The workaround I'm doing for now: import images directly into .mdx and use img tags. Not ideal for writing markdown, but this lets webpack handle the imgs directly

renatobenks commented 2 years ago

Well done @fostimus, thank you for sharing your workaround to this, it'll be helpful.

I'll be closing this issue once we have an entire roadmap, and we're going through it, which involves upgrading gatsby as well as everything else needed to that, including remark.