Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vs-picgo使用picgo配置文件剪切板上传成功,但无反应 #75

Closed
lpx0312 opened this issue Dec 26, 2020 · 7 comments
Closed

Comments

@lpx0312
Copy link

lpx0312 commented Dec 26, 2020

描述错误:vs-picgo使用picgo配置文件剪切板上传成功,但无反应

      vscode环境:
      版本: 1.52.1
      提交: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
      日期: 2020-12-16T16:34:46.910Z
      Electron: 9.3.5
      Chrome: 83.0.4103.122
      Node.js: 12.14.1
      V8: 8.3.110.13-electron.0
      OS: Windows_NT x64 10.0.17763

picgo:2.2.2

vs-picgo:v2.1.0

picgo配置:

image

vs-picgo:配置

image

picgo使用功能全部正常,vs-picgo使用vscode内部设置 剪切板和文件上传也全部正常
但是如果vs-picgo中使用picgo的data.json文件,按Ctrl+Alt+U剪切板上传显示成功,但是没有反应,其他的文件上传功能还是OK的,

vs dev tools 报错如下

image

清除tools中的consle再次剪切板上传,报错如下

image

image

期间更换过电脑,现象依旧。

@upupming
Copy link
Member

upupming commented Dec 28, 2020

macOS 无法复现这个问题macOS之前用错配置文件了,也能复现这个问题,我尝试一下 Windows

@upupming
Copy link
Member

upupming commented Dec 28, 2020

和这个错误是一样的:PicGo/PicGo-Core#32 (comment)
image

但是貌似问题根源不是一样的,马上会进行一下修复

upupming added a commit that referenced this issue Dec 28, 2020
also update picgo core
add failed message
@upupming
Copy link
Member

Bug 出在这一行,我们不需要配置文件里面的 GUI 模式:
https://github.com/PicGo/PicGo-Core/blob/master/src/utils/getClipboardImage.ts#L30

@upupming
Copy link
Member

@421696067 问题已经修复,请下载最新版 vsix 安装包手动安装:https://github.com/PicGo/vs-picgo/actions/runs/449033628

将会在下个 release 发布

@upupming
Copy link
Member

upupming commented Dec 28, 2020

Windows 平台下,PicGo-Electron 的文件全都在 C:\Users\你的用户名\AppData\Roaming\picgo 下。 https://picgo.github.io/PicGo-Doc/zh/guide/config.html

在 PicGo-Electron 里面初始化 picgo 的时候指定了 configPathC:\Users\你的用户名\AppData\Roaming\picgo,因此 使用 GUI 模式,运行脚本才没问题能够找到 Roaming 下的脚本

CLI 应用不应该去依赖 Electron 的脚本(在这个 Bug 中就是 vs-picgo 在初始化 picgo-core 的时候没有指定 configPath,picgo-core走到 GUI 的逻辑到默认路径 C:\Users\你的用户名\.picgo\ 之下去找脚本了,找不到脚本,运行了空脚本就报错了),CLI 应用应该都需要使用 node_modules 里面 picgo 自带的脚本,将 PICGO_ENV 置为 CLI 是最好的选择。

使用picgo core开发应用打包的时候注意 Webpack 要复制一下 clipboard 里面的脚本:

// webpack.config.js
new CopyPlugin({
      patterns: [{ from: 'node_modules/picgo/dist/src/utils/clipboard', to: 'clipboard' }],
    }),

@lpx0312
Copy link
Author

lpx0312 commented Dec 29, 2020

感谢 感谢 安装vsix插件后,已修复,Webpack 是这样添加?不添加也正常了呢。
image

@upupming
Copy link
Member

@421696067 添加webpack是指我们的代码里面加了这个,作为使用者不需要操心哈

upupming added a commit that referenced this issue Jan 5, 2021
* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75

also update picgo core
add failed message

* 🐛 Fix(version): 2.0.4 -> 2.1.0

* 📦 Chore(deps): update deps

* 📦 Chore(bundle): add webpack
Spades-S added a commit that referenced this issue Jul 26, 2021
* 📦 Chore: add bump version (#32)

* 📦 Chore: add picgo bump version

* 📦 Chore: substitute npm with yarn

* 📦 Chore: move pre-commit to husky for using by `git cz`

* 📦 Chore: finish azure pipeline & remove appveyor

* 🔙 Revert: fix mistake in test script

* 📝 Docs: make readme tidier

* 📝 Docs: revert to details/summary tags

* 📝 Docs: update license

* 📝 Docs: add upupming to license

* 📝 Docs: currect azure project name (#33)

* ⬆️ Upgrade: picgo to 1.3.6

fix bugs when upload images from clipboard in Windows 7

ISSUES CLOSED: #34

* 🎉 Release: 2.0.4

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: code structure, message consistency, fix settings changing issue, out-of-box format(#36)

* 🔨 Refactor: code structure

* 🐛 Fix: picgo -> vspicgo, prettier fix

* 🐛 Fix: on load -> before upload plugin

* 🎨 Style: log -> data

* 🐛 Fix: get config, editor each time

* 🎨 Style: message consistency

* 🐛 Fix: qiniu.area enum -> string

* 🐛 Fix: update picgo on settings changed

* ✨ Feature: out-of-box format

* 🔙 Revert: still using enum for qiniu area

* 🔨 Refactor: singleton pattern for `picgo`

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: replace require with fs

* 📝 Docs: readme.md

add summary tag in details tag aimed at PicGo-electorn users

* 📝 Docs: fix custom upload name & custom output format docs

* 📝 Docs: update issue templates

* 📝 Docs: code format

* ✅ Test: add basic testes (#42)

* ✅ Test: add basic testes

* 🐛 Fix: import -> require

* 🐛 Fix: build

* 📦 Chore: add coveralls env

* ✨ Feature: test report on command line

* Update package.json

* 🐛 Fix: coverage

* ✨ Feature: report to coveralls

* 🐛 Fix: use sed to fix lcov.info's relative path

* ⬆️ Upgrade: fix querystringify vulnerability

* 🐛 Fix: azure pipeline + coveralls

see
https://github.com/dylan-smith/node-coveralls/blob/10e327653aa0f2f382efee3af800beae0aabaac5/lib/getOptions.js

* 📦 Chore: azure -> github actions

* ✨ Feature(package.json): support sm.ms V2

upgrade dependencies, support sm.ms V2

ISSUES CLOSED: #57

* 📦 Chore: replace tslint with eslint

* 📦 Chore(.vscode): update .vscode

* 🎨 Style: run codestyle:fix

* 📝 Docs: update docs: README.md, CHANGELOG.md

* 📝 Docs: update README.md

* ✅ Test(test): refactor unit tests

* 📦 Chore: add coverage collector

* build(deps): bump lodash from 4.17.15 to 4.17.19 (#68)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump decompress from 4.2.0 to 4.2.1 (#71)

Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](kevva/decompress@v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump ini from 1.3.5 to 1.3.7 (#73)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: 🎸 add support for svg (#74)

add support for svg image while choosing files

* 🐛 Fix(ci): github actions use yarn to lock versions (#77)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75 (#78)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75

also update picgo core
add failed message

* 🐛 Fix(version): 2.0.4 -> 2.1.0

* 📦 Chore(deps): update deps

* 📦 Chore(bundle): add webpack

* 🐛 Fix(proxy): add proxy config, fixes #79

* ⬆️ Upgrade: update picgo core

* 📦 Chore: migrate to standardjs (#83)

* 🚧 WIP(code style): migrate to standardjs

* 🐛 Fix(upload): upload events off

* ✅ Test: fix test configuration

* 📦 Chore: add console for message

* 🐛 Fix: show message should not block following operations

* ⬆️ Upgrade(core): upgrade dependencies (#92)

Co-authored-by: Yiming Li <yimingli.cs@gmail.com>

* 🎉 Release: v2.1.1

* 🐛 Fix(dep): bundle picgo-core to dist

* 🎉 Release: v2.1.2

Co-authored-by: Li Yiming <upupming@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kkyeer <kkyeer@gmail.com>
Co-authored-by: Yiming Li <yimingli.cs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants