cypress-file-upload plugin working correctly with Cypress v4.11.0 but after updating Cypress to v5.0.0 the file upload functionality fails.
Error: CypressError: base64StringToBlob() no longer returns a Promise. Update the use of base64StringToBlob() to expect a returned Blob

In 5.0.0, Cypress updated the Blob utility from 1.3.3 to 2.0.2, which itself had a broken change underneath.
The return type of the Cypress.Blob methods arrayBufferToBlob, base64StringToBlob, binaryStringToBlob, and dataURLToBlob have changed from Promise
This plugin will need to be updated to reflect this change outlined in our migration guide as well as its documentation: https://on.cypress.io/migration-guide#Return-type-of-Cypress-Blob-changed
Any way to work around the issue while waiting for an updated release? We're quite heavily relying on this plugin and can't update cypress :D
@mduft Other than manually patching the changes in #215, there's not a lot that you can do.
We tried manually targeting the PR, but that did not yield any results.
By when this can be updated, I am waiting for this to be updated before I upgrade cypress
By when this can be updated, I am waiting for this to be updated before I upgrade cypress
I tried to test the change, but somehow it does not seem to work for me - still getting the same error message. Maybe cypress devs can help out with some information...
Following, but for what it's worth, our tests have started to fail as well. However, our tests where we try to upload a PDF document are still passing, but all other doc types fail including (PNG, JPG, DOCX, and XLSX)
Any workarounds would be great... we need this when uploading XLSX files
Hi, I ran into the same issue today with a slightly different error message:
CypressError: `binaryStringToBlob()` no longer returns a `Promise`. Update the use of `binaryStringToBlob()` to expect a returned `Blob`.
https://on.cypress.io/migration-guide
at Blob.val.then (http://localhost:3000/__cypress/runner/cypress_runner.js:180527:71)
at getRet (http://localhost:3000/__cypress/runner/cypress_runner.js:154850:20)
at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:9852:23)
at Function.Promise.attempt.Promise.try (http://localhost:3000/__cypress/runner/cypress_runner.js:7126:29)
at Context.thenFn (http://localhost:3000/__cypress/runner/cypress_runner.js:154868:26)
at Context.then (http://localhost:3000/__cypress/runner/cypress_runner.js:155308:21)
at Context.<anonymous> (http://localhost:3000/__cypress/runner/cypress_runner.js:168808:21)
From Your Spec Code:
A workaround would be great.
This looks like a way for a workaround if you resist downgrading like me :)
const special = 'file.spss';
cy.fixtures(special, 'binary')
.then(Cypress.Blob.binaryStringToBlob)
.then((fileContent) => {
cy.get('[data-cy="file-input"]').attachFile({ fileContent, filePath: special, encoding: 'utf-8' });
})
I'm getting cy.fixtures is not a function but working on that as well.
I'm getting
cy.fixtures is not a functionbut working on that as well.
cy.fixture singular, no s at the end I think?
What is the progress of this issue?
I am migrating a quite huge project and this is the last issue I have.
@keeema seems will take some time to be fixed as per the above.
I can recommend you to roll-back to 4.12 in case you do not need any of 5.0.0 changelog items
Still waiting for the maintainer to step up and merge and release #215 ...
any news on this issue? I am experiencing exactly the same problem too with the latest version of cypress.
Hey all! After speaking with @abramenal , it seems the best way forward is for another person to become a maintainer on this project. Looking forward to working with you all!
This is my first time being an OSS maintainer, so please be gentle.
There is an open PR and I'm working with the author to get it ready. Thanks for your patience!
Most helpful comment
Hey all! After speaking with @abramenal , it seems the best way forward is for another person to become a maintainer on this project. Looking forward to working with you all!
This is my first time being an OSS maintainer, so please be gentle.
There is an open PR and I'm working with the author to get it ready. Thanks for your patience!