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

cy.intercept() TypeError: mime.getType is not a function #290

Open
vmcruz opened this issue Mar 31, 2022 · 2 comments
Open

cy.intercept() TypeError: mime.getType is not a function #290

vmcruz opened this issue Mar 31, 2022 · 2 comments

Comments

@vmcruz
Copy link

vmcruz commented Mar 31, 2022

Hi team, we upgraded from Cypress 8.7.0 to Cypress v9.4.1 as this is the latest supported in Browserstack according to the docs https://www.browserstack.com/docs/automate/cypress/limitations

One of our tests uses cy.intercept and after the upgrade we noticed the following error in that test:

TypeError: An error was thrown while processing a network event: mime.getType is not a function
  TypeError: mime.getType is not a function
      at ret (/root/app/packages/server/lib/controllers/xhrs.js:120:19)
      at parseContentType (/root/app/packages/server/lib/controllers/xhrs.js:124:14)
      at /root/app/packages/net-stubbing/lib/server/util.js:106:107
      at Generator.next (<anonymous>:null:null)
      at fulfilled (/root/app/packages/net-stubbing/lib/server/util.js:5:58)

After debugging, I found out that the problem might be the version of the mime package, as it is used to parse the response mime type. Version 2.4.4 introduced breaking changes (like renaming lookup in favor of getType), but what is weird is that this version upgrade (from 1.6 to 2.4.4) was made in Cypress v4.3.0 so...not sure what's going on.

Any help will be much appreciated. Thank you in advance.

@randalvance
Copy link

randalvance commented May 17, 2022

We also encountered the exact issue when using Cypress 9. Reverting back to Cypress 8 in browserstack.json resolves the issue.

@bhumikababbar
Copy link

Can you try with the latest version of Cypress - 9.6.1 which is being supported by BrowserStack?
Is this issue encountered when you execute locally on your machine?

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

No branches or pull requests

3 participants