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

Feature: use Path for better cross platform support #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

khawkins98
Copy link

This stops errors on Windows like:

PS C:\...\Documents\GitHub\visual-differ> node index.js

Generating images from your URLs...
 ■■■■■■■■■■■■■■■■■■■■                    ■ 50% | ETA: 15s | 1/2

Diffing images and creating report...
                                         ■ 0% | ETA: 0s | 0/1node:fs:599
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'screenshots/2022_12_28__11-54-53/1/a.png'
    at Object.openSync (node:fs:599:3)
    at Object.readFileSync (node:fs:467:35)
    at C:\Users\...\Documents\GitHub\visual-differ\index.js:97:10 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'screenshots/2022_12_28__11-54-53/1/a.png'
}

Node.js v18.4.0

This stops errors on Windows like:

```
PS C:\...\Documents\GitHub\visual-differ> node index.js

Generating images from your URLs...
 ■■■■■■■■■■■■■■■■■■■■                    ■ 50% | ETA: 15s | 1/2

Diffing images and creating report...
                                         ■ 0% | ETA: 0s | 0/1node:fs:599
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'screenshots/2022_12_28__11-54-53/1/a.png'
    at Object.openSync (node:fs:599:3)
    at Object.readFileSync (node:fs:467:35)
    at C:\Users\...\Documents\GitHub\visual-differ\index.js:97:10 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'screenshots/2022_12_28__11-54-53/1/a.png'
}

Node.js v18.4.0
```
Puppeteer was about a year out of date, nice to test on a more recent version of chromium.
@khawkins98
Copy link
Author

I've also tossed in a package.json dependency update. Meant to do that as a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant