aui / font-spider

Smart webfont compression and format conversion tool
http://font-spider.org
MIT License
5.02k stars 402 forks source link

Error : TypeError [ERR_INVALID_ARG_TYPE] #178

Open PLQin opened 5 years ago

PLQin commented 5 years ago

执行命令 font-spider *.html 时报错 :

(node:17032) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type object
    at Url.parse (url.js:150:11)
    at urlParse (url.js:144:13)
    at Url.resolve (url.js:659:29)
    at Object.urlResolve [as resolve] (url.js:655:40)
    at HTMLLinkElement.get [as baseURI] (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\src\node.js:101:28)
    at HTMLLinkElement.get (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\src\elements\html-link-element.js:15:37)
    at Document.get (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\src\document.js:102:56)
    at loadCssFiles (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\src\style\load-css-files.js:15:32)
    at Window.set [as onload] (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\index.js:72:17)
    at start (C:\Users\trimmobi\AppData\Roaming\npm\node_modules\font-spider\node_modules\browser-x\index.js:36:27)
(node:17032) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17032) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

环境 :
$ node -v v10.11.0

$ font-spider --version 1.3.5

window10

PLQin commented 5 years ago

@aui 老板, 求解答

coufran commented 5 years ago

我也报同样的错误了,最后发现是有一段不标准的CSS引用,把下面这段去掉好了。 <link webkit="href" type="text/css" rel="stylesheet" _href="css/index-webkit.css"/>