Open lfades opened 4 years ago
Hey @lfades is it okay if I take this issue up?
I was able to reproduce the issue locally and noticed that the reason the page goes blank is because dangerouslySetInnerHTML
seems to be auto closing the open tag while wrapping any HTML/Scripts etc.. underneath inside of the tag.
This does not cause the page to go blank if that invalid html tag is a
Bug report
Describe the bug
If invalid HTML is added to
dangerouslySetInnerHTML
, Next.js will output a blank page without providing any feedback. This can be hard to track when working with a CMS provider or markdown files.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
yarn && yarn dev
ornpm i && npm run dev
pages/index.js
is a blank page with no errorsExpected behavior
Invalid HTML inside
dangerouslySetInnerHTML
should throw and/or let the user know that there's something wrong.The demo also has an
index.html
andindex.js
in the root directory that shows how the same code works in React alone, it doesn't produce an error either, but it shows the content.