rrweb-io / rrweb-snapshot

rrweb's snapshot and rebuild module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided is empty.

sumbatx15 opened this issue · comments

Hi there awesome people,
If the DOCTYPE has no name in it (HTML or whatever) like so
image

Then the node will look like this after the recorder
{ type: 1, name: '', publicId: '', systemId: '', id: 2 },

And then when we try to replay that it tries to createDocumentType with no name
image

and fails with this message
Uncaught DOMException: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided is empty.

I would suggest to make a default value of HTML
n.name || 'html'

Like your job, keep up the good work !

commented

Thanks for the report and suggestions!