kbone编译vue项目为微信小程序报thirdScriptError错误,该怎么解决?
发布于 6 年前 作者 guiying68 10916 次浏览 来自 问答

已存在的vue项目,运行正常,使用kbone进行编译后,报错:

问题定位到,document.implementation为undefined:

// Support: Safari 8 only
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
// Because of that, this security measure has to be disabled in Safari 8.
// https://bugs.webkit.org/show_bug.cgi?id=137337
support.createHTMLDocument = ( function() {
	var body = document.implementation.createHTMLDocument( "" ).body;
	body.innerHTML = "<form></form><form></form>";
	return body.childNodes.length === 2;
} )();
1 回复

kbone 不支持 document.implementation.createHTMLDocument 接口,对于 kbone 不支持的 dom 接口,可以使用扩展能力来兼容或改造成你希望达到的状况:https://wechat-miniprogram.github.io/kbone/docs/guide/advanced.html#%E6%89%A9%E5%B1%95-dom-bom-%E5%AF%B9%E8%B1%A1%E5%92%8C-api

回到顶部