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

If screenshot-plugin's multiple custom-presets are set, the output images will be overwritten. #298

Closed
6 tasks done
sor4chi opened this issue Sep 19, 2022 · 1 comment · Fixed by #299
Closed
6 tasks done
Labels
to triage This issue needs to be triaged

Comments

@sor4chi
Copy link
Contributor

sor4chi commented Sep 19, 2022

Describe the bug

When multiple presets are defined by the user, the captured and written file is overwritten in the next loop because file save is performed multiple times without changing the file name in the loop, as shown in the code in the reference link below.

So, we need to use the other name for saving in every loop.

histoire config ts

Reproduction

https://github.com/histoire-dev/histoire/blob/main/packages/histoire-plugin-screenshot/src/index.ts#L67

System Info

System:
    OS: macOS 12.3
    CPU: (8) arm64 Apple M1
    Memory: 109.88 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.2 - ~/.nodebrew/current/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.18.0 - /opt/homebrew/bin/npm
    Watchman: 2022.08.22.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 101.0.1
    Safari: 15.4
  npmPackages:
    @histoire/plugin-screenshot: ^0.10.7 => 0.10.7 
    @histoire/plugin-vue2: ^0.10.7 => 0.10.7 
    @vitejs/plugin-vue2: ^1.1.2 => 1.1.2 
    histoire: ^0.10.7 => 0.10.7 
    vite: ^3.1.0 => 3.1.0 

Used Package Manager

npm

Validations

@sor4chi sor4chi added the to triage This issue needs to be triaged label Sep 19, 2022
@sor4chi
Copy link
Contributor Author

sor4chi commented Sep 19, 2022

I'm fixing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant