PicGo / vs-picgo

A VSCode plugin of PicGo

Home Page:https://marketplace.visualstudio.com/items?itemName=Spades.vs-picgo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[PicGo ERROR]: read file Windows PowerShell

sunsteam opened this issue · comments

阿里云oss上传截切板图片失败,情况类似 issue #85 ,他写过的内容我就不重复了,补一下console的图

另外,直接用picGo的GUI上传剪切板图片是成功的,只有插件的CTRL ALT U 上传有问题

  • vs-picgo version

2.1.0,直接从VS插件库中安装的

Additional context

Is this bug picBed specific, i.e. only the picBed you use is affected? 未尝试其他图床

Is there any error in the console (Help -> Toggle Developer tools)?: Yes

image

贴一下我power shell版本信息

image

@sunsteam read file error 参考 https://github.com/PicGo/PicGo-Core/blob/85ecd16253ea58910de63511ea95e6f6fb6249d6/src/utils/common.ts#L59 ,估计是这里抛出的错误

我的版本和你一样但是没有报错:

image

image

可以麻烦你调试一下吗,具体的做法是打开文件 C:\Users\你的用户名\.vscode\extensions\spades.vs-picgo-2.1.0\node_modules\picgo\dist\src\plugins\transformer\path.js,在这里加一行:

image

console.log(`${item} is trouble maker`);

在这里再加一行:

image

console.error(`the error detail is ${_a}`)

然后重启 VSCode,再传一张图片,看一下控制台输出的是什么

image

@upupming 按你的要求如图

@sunsteam 麻烦也打印一下 item 看看呢:

image

console.log(`${item} is trouble maker`);

image

@upupming 按你的要求如图

这个报错是 fs 的报错, fs 读取文件出错就会抛出这个错误,例如:

image

看这个报错,传给 fs 的文件名居然是 powershell 这一串路径,想起来了这个问题已经修复过了,是这个:#75

请使用最新的 dev 安装包,在这里可以下载:https://github.com/PicGo/vs-picgo/actions/runs/880309819

我待会会发一个包,修复了一下 Bug 但是还没有发过包,导致大家一直问一样的问题,时间太久我也忘记了 😅

共同的原因应该都是使用了 PicGo GUI 本身的配置文件,但是 GUI 的配置文件的 PICGO_ENV 设置的是 GUI,会导致尝试使用 PicGo GUI 的 powershell 脚本而出现问题

已发包,请更新最新版 vs-picgo 2.1.2 使用