allanguys / font-spider-plus

font-spider-plus(字蛛+)是一个智能 WebFont 压缩工具,它能自动分析出本地页面和线上页面使用的 WebFont 并进行按需压缩。
MIT License
709 stars 51 forks source link

fsp run运行时报错 #25

Open EmptyDreams opened 2 years ago

EmptyDreams commented 2 years ago

错误内容:

\ 正在分析配置中的网址...(node:16832) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of undefined
    at intoTokens (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\tokenizer\tokenize.js:311:17)
    at tokenize (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\tokenizer\tokenize.js:77:10)
    at fromStyles (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\reader\read-sources.js:147:12)
    at fromString (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\reader\read-sources.js:48:10)
    at doReadSources (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\reader\read-sources.js:33:12)
    at readSources (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\reader\read-sources.js:24:10)
    at C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\clean.js:115:12
    at C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\clean.js:135:34
    at minify (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\clean.js:114:35)
    at CleanCSS.minify (C:\Users\EmptyDreams\AppData\Roaming\npm\node_modules\font-spider-plus\node_modules\clean-css\lib\clean.js:77:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16832) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16832) [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.

JS配置内容

{
    "localPath" : "../source/self/fonts/",
    "onlinePath" : "../self/fonts/",
    "url" :  [
        "http://localhost:4000/"
    ]
}

注:服务器在本地上,用hexo s生成的,所以用的本地链接

EmptyDreams commented 2 years ago

又测试了一下,服务端测试也会报这个错误

allanguys commented 2 years ago

检查下本地的localpath路径是不是可以找的到

EmptyDreams commented 2 years ago

检查下本地的localpath路径是不是可以找的到

本地测试的话会有相对路径的问题,我在另一个issuse中写了。 我不知道本地测试会不会有这个问题,因为我不清楚这两个错误如果都有的话应该哪一个先发生。