Skip to content

Conversation

@MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Nov 12, 2025

Additional details

In the directories:

  1. update the npm module mime from mime@^3.0.0 to mime@^4.1.0 (current latest).
  2. remove the use of the deprecated npm module @types/mime.

The npm module @types/mime is deprecated and shows the message:

This is a stub types definition. mime provides its own type definitions, so you do not need this installed.

Steps to test

git clean -xfd
n auto
yarn
yarn workspace @packages/driver check-ts
yarn workspace @packages/net-stubbing check-ts
yarn workspace @packages/server check-ts

In separate terminal window:

cd .. # to cypress-io directory
git clone https://github.com/cypress-io/cypress-example-kitchensink
cd cypress-example-kitchensink
npm ci
npm start

In cypress terminal window:

yarn cypress:run --project ../cypress-example-kitchensink

How has the user experience changed?

No change expected to user experience.

PR Tasks


Note

Upgrades mime to 4.1.0 across packages, removes @types/mime, updates tests to new JS MIME type, and adds changelog entry.

  • Dependencies:
    • Bump mime from ^3.0.0 to ^4.1.0 in packages/driver/package.json, packages/net-stubbing/package.json, and packages/server/package.json.
    • Remove deprecated @types/mime from devDependencies where present.
    • Update yarn.lock to resolve [email protected].
  • Tests:
    • Update expected MIME for .js files from application/javascript to text/javascript in packages/driver/cypress/e2e/commands/actions/selectFile.cy.ts.
  • Docs/Changelog:
    • Add dependency update note for mime upgrade in cli/CHANGELOG.md.

Written by Cursor Bugbot for commit 47475c3. This will update automatically on new commits. Configure here.

Remove deprecated @types/mime - no longer needed with mime v4
@cypress-app-bot
Copy link
Collaborator

@jennifer-shehane jennifer-shehane self-requested a review November 12, 2025 18:32
@MikeMcC399 MikeMcC399 marked this pull request as draft November 13, 2025 11:40
@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane

There are some hard errors in this PR.

The driver-integrations-tests-* like the following show a common issue:

In https://app.circleci.com/pipelines/github/cypress-io/cypress/77013/workflows/d738ac62-dac8-42d3-9cae-20445449f5c4/jobs/3295755

  1. src/cy/commands/actions/selectFile
    #selectFile
    shorthands
    works with passed in paths:

    AssertionError: expected 'text/javascript' to equal 'application/javascript'

    • expected - actual

    -'text/javascript'
    +'application/javascript'

According to RFC 9239 from May 2022, application/javascript is an obsolete alias of text/javascript.

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

Changed test packages/driver/cypress/e2e/commands/actions/selectFile.cy.ts to check for text/javascript instead of checking for the obsolete and deprecated mime-typ application/javascript.

Running the following locally now passes:

yarn workspace @packages/driver cypress:run --spec cypress/e2e/commands/actions/selectFile.cy.ts

@MikeMcC399 MikeMcC399 marked this pull request as ready for review November 13, 2025 15:51
@jennifer-shehane
Copy link
Member

@MikeMcC399 CI won't trigger if the PR is in draft - and moving it out of draft does not trigger CI (probably some way we could automate this), so you'll want to do an empty commit after you move it out of draft to have CI run again.

@MikeMcC399

This comment was marked as outdated.

expect($input.files?.[1].name).to.eq('app.js')
expect($input.files?.[0].type).to.eq('application/json')
expect($input.files?.[1].type).to.eq('application/javascript')
expect($input.files?.[1].type).to.eq('text/javascript')
Copy link
Member

@jennifer-shehane jennifer-shehane Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy JavaScript MIME type.

According to RFC 9239 from May 2022, application/javascript is an obsolete alias of text/javascript.

@MikeMcC399

This comment was marked as outdated.

@jennifer-shehane
Copy link
Member

@MikeMcC399 Just very unlucky on your PRs lately 😄

@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane

Just very unlucky on your PRs lately 😄

Not just me affected! It was even on the local radio this afternoon. Once again the Internet has failed in a big way with https://downdetector.com/ painting a big picture of failures.

@jennifer-shehane
Copy link
Member

Starting to wonder if this update is breaking these Studio tests 🤔

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399

This comment was marked as outdated.

@jennifer-shehane
Copy link
Member

Let's try again today! So many outages yesterday 🤦🏻‍♀️

@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane

Let's try again today! So many outages yesterday 🤦🏻‍♀️

Perseverance and patience was rewarded. The errors from yesterday have disappeared into thin air! 😄

@MikeMcC399
Copy link
Contributor Author

The current status is:

  • 2 skipped
  • 9 expected
  • 63 successful checks

What is happening with the expected checks? I don't see anything queued on https://app.circleci.com/pipelines/github/cypress-io/cypress/77260. Are these missing from PRs submitted from contributor forks, or is something else going wrong?

@jennifer-shehane
Copy link
Member

@MikeMcC399 Yah, we updated the flow in CircleCI so those jobs never run for contributor PRs because they require secret keys, so we need different status checks for contributor PRs vs team PRs. I haven't looked into if there's a way to do that.

It's perfect though - all green on the first run!

@jennifer-shehane jennifer-shehane merged commit a267d31 into cypress-io:develop Nov 19, 2025
66 checks passed
@MikeMcC399 MikeMcC399 deleted the issue-30144-mime-to-4.x branch November 19, 2025 15:50
"md5": "2.3.0",
"memfs": "3.5.3",
"mime": "^3.0.0",
"mime": "^4.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcC399 it looks like mime 4+ requires esm support https://github.com/broofa/mime?tab=readme-ov-file#mime. This is fine for the driver because everything gets bundled, but won't work for the server since we can't require it correctly in the ts-node context for our unit tests. https://app.circleci.com/pipelines/github/cypress-io/cypress/77276/workflows/97832e74-5300-4e6a-867e-e5590af97ae1/jobs/3311239 looks like its trying to use the esm loader. It likely works in the server in the binary itself because we use tsx to load the runtime to get bidirectional support https://tsx.is/#seamless-cjs-%E2%86%94-esm-imports.

unfortunately I'm going to have to revert this until we are in a better place with ESM support in the server

CC @jennifer-shehane

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AtofStryker

https://github.com/broofa/mime/blob/main/CHANGELOG.md confirms that [email protected] dropped CJS support.

I did mention that in the issue #30144

Sorry if this update is causing an issue. The CI results looked perfect, so I didn't suspect any issue here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and unfortunately exactly the test which is failing is not carried out for PR contributions from forks, so it wasn't apparent when the PR was merged.

Possibly there is a need to re-route contributor PRs to a feature branch first and then from there do a separate PR under the ownership of a Cypress.io member?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcC399 Yah that was the problem, a subset of tests dont run on contributor PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcC399 no worries the ESM only support felt hidden to me and I didn't notice it the first time around. This wont be the first or last time this happens while we transition to more ECMAScript friendly code.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 19, 2025

Released in 15.7.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v15.7.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to mime current version 4.x

4 participants