inertia icon indicating copy to clipboard operation
inertia copied to clipboard

"Page lacks the HTML doctype" devtools warning

Open jonagoldman opened this issue 3 years ago • 3 comments

Versions:

  • @inertiajs/inertia version: 0.11.0
  • @inertiajs/inertia-vue3 version: 0.6.0

Describe the problem:

Each time a modal is rendered I get this console warning from Lighthouse in Chrome Devtools:

Page lacks the HTML doctype, thus triggering quirks mode.

The issue seems to be that the modal html element is created without the doctype declaration:

https://github.com/inertiajs/inertia/blob/master/packages/inertia/src/modal.ts#L10

I think replacing document​.​createElement​(​'html'​) with document.implementation.createHTMLDocument() will fix the issue as it creates a valid html document (with doctype) instead of a regular element.

jonagoldman avatar Mar 22 '22 09:03 jonagoldman

Hey this report out of curiosity is referring to the development environment modals that Inertia returns when there is an exception or a proper inertia return sent from the backed? as you can see in the documentation this is not meant for production and therefor the lack of proper doc-type is really a non issue.

https://inertiajs.com/error-handling

ninjaparade avatar Apr 25 '22 17:04 ninjaparade

Yes this is about the modals in development, but still an issue nonetheless in my opinion.

jonagoldman avatar Apr 25 '22 17:04 jonagoldman

Think you're standing alone on that one, but good on you for making sure the HTML is proper for a dev debugging tool!

ninjaparade avatar Apr 25 '22 19:04 ninjaparade

Hey! Thanks so much for your interest in Inertia.js and for sharing this issue/suggestion.

In an attempt to get on top of the issues and pull requests on this project I am going through all the older issues and PRs and closing them, as there's a decent chance that they have since been resolved or are simply not relevant any longer. My hope is that with a "clean slate" me and the other project maintainers will be able to better keep on top of issues and PRs moving forward.

Of course there's a chance that this issue is still relevant, and if that's the case feel free to simply submit a new issue. The only thing I ask is that you please include a super minimal reproduction of the issue as a Git repo. This makes it much easier for us to reproduce things on our end and ultimately fix it.

Really not trying to be dismissive here, I just need to find a way to get this project back into a state that I am able to maintain it. Hope that makes sense! ❤️

reinink avatar Jul 28 '23 01:07 reinink