I'm trying to automate the task of downloading mp3 files from a web site and uploading to another web site. With Puppeteer, I'm able to do this with the following code.
// ... Download the file and save locally
// Sets the value of the file input to fileToUpload
inputUploadHandle.uploadFile(fileToUpload);
// ... submit the form
This works fine on my Mac. I can download the file and upload it through the form submit. When I deployed it on Heroku, I'm aware that Heroku's ephemeral file system will save the file to /app folder. And I'm even able to send that saved file through NodeMailer as an attachment.
But on my Heroku app, when Puppeteer submit the form, the file is not uploaded as it should be. The submit happens as if the file is not selected.
I know I can have work arounds like grabbing the file from my own server. But I'm still curious why this happens. What makes Puppeteer uploadFile to fail on Heroku?
By the way, here are two links that might help with the background:
Practical Puppeteer: How to upload a file programmatically
puppeteer-heroku-buildpack
The solution: if you want to use uploadFile, don't use Puppeteer version 2.1.1, for now stick to 2.0.0. In your package.json:
"puppeteer": "2.0.0"
I checked recently and found out that uploadFile is still broken in Puppeteer 5.5.0.
Here's the detail. When I develop on my Mac, I didn't specify a version for puppeteer. But I happened to be using a version in which uploadFile works. However, every time you push to Heroku, Heroku will check your package.json to install all dependencies. In my case, Heroku updated to the latest version (by the time of this writing 2.1.1) which broke the uploadFile function.
Even though I printed out the Chromium version early on and noticed that Heroku is using a higher version, it never occurred to me that I should test with an older version of Puppeteer. Instead, I spent a lot of time testing other workarounds, which all failed. Any way, once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.
I'll post an issue on Puppeteer and hope this to be fixed in the next release.
Related
Hello I tried to upload react native iOS app to App Store. the upload is succefull but when I try to see the build in testFlight it show like this
as you see it show me the version but inside it is empty. then after one minute even the version number disappear and it asks me to upload again. I uploaded it many time but still the same thing
The version disappears if there is another upload with the same version number. Change the version and try to upload the app again.
sorry for the late answer. the issue was the firebase npm packages were not the latest version and it was causing an issue during uploading. So remove all firebase npm packages and install them again after that upload the app.
Today I tried to upload some new files to parse cloud. As usual I performed the parse deploy command, but this time it didn't finish, it gets stuck in uploading source files notice, no error is shown so far.
I left it there for more than 30 minutes(usually it takes less than 2-4 minutes), and nothing.. What can I do to fix this? or where should I look for a log? I'm using ver 1.4.2, updated because I thought it would help.
Any help appreciated.
You must update the CLI to its latest version (currently 2.1.2) you can go to Parse website
or if you still have problems I created a repo containign the files
https://github.com/JRSosa/ParseCLI
I am deploying and ember-cli app to heroku and pretty much everything is working as hoped. The only issue is that when the app precompiles, it adds a fingerprint to images and assets as expected but does not add them to the asset reference within a stylesheet. Specifically, I have a couple of images as background images in stylesheets that when deployed can't be found due to the addition of the fingerprint to the file. How do I either get the fingerprint added to the asset path reference in the stylesheet or tell ember/heroku to not add fingerprint to any files? Thanks for the help.
A little late getting back to this but I ended up just disabling the fingerprinting for now by adding this in the Brocfile.js
var app = new EmberApp({
fingerprint: {
enabled: false
}
});
You just need to upgrade to the latest version of Ember CLI. From version 0.1.3 of Ember CLI there's no need to disable fingerprint. I think it's fixed by this pull request.
According to Ember CLI guide steps to upgrade to the latest version of Ember CLI are included with each release and can be found here.
Before upgrade, I had issues with Lightbox2 and Fancybox(image assets). After upgrade, all references to fingerprinted assets are applied correctly.
I am trying to move some code into a bower package, and my code depends on prototypejs. Prototypejs is not in the bower registry (or it wasn't-- actually I just added it incorrectly, so this question is a bit like asking how to avoid spilling milk after it is already running off the table). What is the proper way to go about getting it there?
I thought I could just point the registry to the prototypejs repo on github, but that resulted in a checkout of files which did not include a built prototype.js file, and it seems it can't be built with the latest version of ruby/rake. So, one option would be to create a new github repo with the built version (downloaded from the website) and a bower.json file. Development on prototypejs seems to have stalled (according to github), so it is unlikely the author(s) would be doing that anytime soon.
DISCLAIMER
I'm beating my own drum but this should help
My PrototypeJS repo has updates in it as well as can be built using grunt and has the actual finished build files in it. Please take a look and see if it works for you.
https://github.com/jwestbrook/prototype
I would create a repo with as you suggested for now, but still try to submit a PR on the upstream repo.
I'm using the Ramaze framework for my rack app, and whenever I save a file in my app on my computer or use git push to give the server the newest files, for Heroku and refresh the page, I'm greeted with the page without the layout file. Strangely it doesn't happen on my computer if I wait before saving the page, but will if I dom't wait.
I must refresh again to get this.
It doesn't happen on Dotcloud, Cloud Foundry or Openshift. I cannot upgrade to the latest version of Ramaze as it's not backwards compatible, so I'd have to make more changes. I'm using Rack version 1.4.2 and Ramaze version 2012.04.14