hagnerd / gatsby-starter-blog-mdx

Live Demo
https://gatsby-starter-blog-mdx-demo.netlify.com
MIT License
67 stars 43 forks source link

fix: gatsby-remark-images missing styles #17

Closed d4rekanguok closed 5 years ago

d4rekanguok commented 5 years ago

Hey @hagnerd, thanks for converting the starter to mdx! I used your starter to debug a few mdx issues. here and here 💪

I noticed that gatsby-remark-images didn't work properly.

It turned out a recent patch version of gatsby-remark-images does not function properly with gatsby-plugin-mdx. The previously inline styling of the image is now moved to gatsby-ssr render step, which unfortunately isn't recognized by Gatsby (since gatsby-plugin-mdx use gatsbyRemarkPlugins instead of plugins.)

An accepted workaround source is to add gatsby-remark-images to plugins options, in addition to gatsbyRemarkPlugins.

Until an official solution happens, I thought it'd make sense to add this work around to the starter. Of course only if you think that's a good idea.

Thanks again!

d4rekanguok commented 5 years ago

Oops I've just realized someone has already filed an issue in #15 -- I guess this will close #15 if merged

hagnerd commented 5 years ago

Hey @d4rekanguok thanks for the PR! Merging now. Sorry about the delay, I'm on a client that uses a separate Git client so I haven't been keeping up with my personal one.