-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dangerouslySetInnerHTML does not work on production builds #11108
Comments
Thank you for opening this @tbinte Can you please link to a minimal reproduction for this? |
@tbinte This is a bug in React facebook/react#5479 and possible duplicate of #2750
|
I can confirm, using div's instead of p solved the problem. |
@tbinte thanks for letting us know that. I'll be closing this issue for now, if you need any further information regarding this please follow up on the issue I mentioned in the previous comment. |
Just as a further note, I encountered this issue a couple days ago. I have reproduced the issue at this repository. Swapping out |
I spent couple of hours today trying to fix this before stumbling on this issue. Could we keep this issue open until it is fixed. Gatsby prod-build should match develop behavior, so this is indeed a bug. Right? |
A bit annoying but glad to have found folks struggling with the same issue. Switching from p to div worked. |
I did it with a div because of this thread, but actually is very anoying and somebody should explain a little bit more! |
Found this on google and felt the need to add more context in case anyone else does the same. The reason this works for For example, if you were to write the following: <p class="outer">
<p class="inner"></p>
</p> This would result in (on render): <p class="outer"></p>
<p class="inner"></p>
<p></p> The |
- changed it because it causes the not rendering text at first load bug - see gatsbyjs/gatsby#11108 for more info
I still habe the same problem. dangerouslySetInnerHTML is not working in production mode on my netlify project https://thoughts-on-coding.netlify.app. It should show a summary at each card but dose it only after entering the post contents and going back afterwards. I'm using gatsby 2.29.1, the repository can be found here https://github.com/Ben1980/thoughts-on-coding |
@Ben1980 You're using the <Typography variant="body1" component="p" ... /> Try removing the |
Caused by: gatsbyjs/gatsby#11108
I'm transforming and adding frontmatter content from markdown to html to my page, with the help of showdown. Its working on develop builds, unfortunately in production builds the content is missing.
Here's the page code:
Thank you for the support,
Thomas
The text was updated successfully, but these errors were encountered: