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

[Bug]: When puppeteering a remote browser running on a different OS, page.uploadFiles does not work #8499

Closed
codr1 opened this issue Jun 10, 2022 · 2 comments · Fixed by #8505
Labels

Comments

@codr1
Copy link

codr1 commented Jun 10, 2022

Bug description

Steps to reproduce the problem:

  1. Puppeteer a remote browser on a different OS. (in my case my script is running on Linux, and puppeteering Windows).
  2. Try to upload a file.
  3. Fail.

The issue are the follwing lines in page.uploadFile

*const files = filePaths.map((filePath) => {
if (path.isAbsolute(filePath)) {
return filePath;
}
else {
return path.resolve(filePath);
}
})

path.isAbsolute() is not OS independent. If you are on Linux, and pass C:\path\file, it returns false. So then we resolve, and return something like
/home/user/dir/C:\path\file

Puppeteer version

14.3

Node.js version

16.13

npm version

8.5.0

What operating system are you seeing the problem on?

Linux, Windows

Relevant log output

No response

@codr1 codr1 added the bug label Jun 10, 2022
@codr1
Copy link
Author

codr1 commented Jun 10, 2022

This is a pretty niche use case and there are probably people relying on the path.resolve(), but it would be nice to be able to somehow turn this check off.

@codr1 codr1 changed the title [Bug]: When puppeteering a remote browser running a different OS, page.uploadFiles does not work [Bug]: When puppeteering a remote browser running on a different OS, page.uploadFiles does not work Jun 10, 2022
@codr1
Copy link
Author

codr1 commented Jun 10, 2022

@jrandolf - you are a machine, my friend! Amazing work.

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

Successfully merging a pull request may close this issue.

1 participant