PicGo / vs-picgo

A VSCode plugin of PicGo
https://marketplace.visualstudio.com/items?itemName=Spades.vs-picgo
MIT License
373 stars 52 forks source link

上传图片一直显示“image uploading” #22

Closed handbye closed 5 years ago

handbye commented 5 years ago

报错日志:

[[object Object]]Cannot read property 'PICGO_ENV' of undefined
$onExtensionRuntimeError @ mainThreadExtensionService.ts:60
_doInvokeHandler @ rpcProtocol.ts:399
_invokeHandler @ rpcProtocol.ts:384
_receiveRequest @ rpcProtocol.ts:304
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:584
a @ ipc.net.ts:392
e @ ipc.net.ts:399
fire @ event.ts:584
_receiveMessage @ ipc.net.ts:678
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:549
fire @ event.ts:584
acceptChunk @ ipc.net.ts:212
_register._socket.onData.e @ ipc.net.ts:173
t @ ipc.net.ts:24
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
mainThreadExtensionService.ts:61 TypeError: Cannot read property 'PICGO_ENV' of undefined
    at Promise (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\node_modules\picgo\dist\utils\getClipboardImage.js:16:30)
    at new Promise (<anonymous>)
    at Object.getClipboardImage [as default] (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\node_modules\picgo\dist\utils\getClipboardImage.js:12:12)
    at PicGo.upload (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\node_modules\picgo\dist\core\PicGo.js:105:83)
    at upload (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\out\extension.js:114:11)
    at uploadImageFromClipboard (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\out\extension.js:18:21)
    at vscode.commands.registerCommand (c:\Users\10103\.vscode\extensions\spades.vs-picgo-1.0.6\out\extension.js:147:81)
    at d._executeContributedCommand (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:477:621)
    at d.$executeContributedCommand (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:478:6)
    at d._doInvokeHandler (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:622:11)
    at d._invokeHandler (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:621:716)
    at d._receiveRequest (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:620:394)
    at d._receiveOneMessage (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:619:141)
    at define.constructor._protocol.onMessage.e (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:617:400)
    at u.fire (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
    at e (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:40:460)
    at u.fire (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
    at a (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:467)
    at e (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:513)
    at u.fire (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
    at y._receiveMessage (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:181:276)
    at define.constructor._socketDisposables.push._socketReader.onMessage.e (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:178:415)
    at u.fire (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
    at f.acceptChunk (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:175:35)
    at define.constructor._register._socket.onData.e (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:174:410)
    at Socket.t (c:\software\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:182:689)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20)

vscode的配置文件如下:

{
  "workbench.colorTheme": "Noctis Lux",
  "files.autoSave": "onWindowChange",
  "markdownlint.config": {
   "default": true,
   "MD002": false,
   "MD007": { "indent": 4 },
   "MD041": false,
   "MD045": false
  },
  "picBed": {
    "current": "github",
    "github": {
      "repo": "xxxxx",
      "token": "xxxxx",
      "path": "",
      "customUrl": "",
      "branch": "master"
   }
  },
  "git.autofetch": true,
  "git.enableSmartCommit": true,
  "git.confirmSync": false,
}
upupming commented 5 years ago

请找到这一行:

at upload (c:\Users\10103.vscode\extensions\spades.vs-picgo-1.0.6\out\extension.js:114:11)

粘贴这一行周围的代码到这里一下

upupming commented 5 years ago

@handbye 你现在使用的是 v1.0.6,配置请参考这里 image 使用 github 图床需要在这里配置 repotoken 信息: image

推荐使用 smms,无需配置直接使用。

PS: vs-picgo v2.0.0 即将发布,配置项将会进行修改,增加了提示信息方便用户理解,同时增加模板变量自定义输出格式,请注意更新!

upupming commented 5 years ago

Nightly build v2.0.0 is available at https://ci.appveyor.com/project/upupming/vs-picgo/build/artifacts, any feedback is welcome!