Skip to content

Yarn 3 does not work with type=module and cypress.config.js #25959

@lmiller1990

Description

@lmiller1990

Ref: #22747 -> #22747 (comment)

Repro: yarn3typemodule.zip

Workaround: change cypress.config.js to be named cypress.config.mjs. This should fix the issue. This means anything imported in cypress.config.mjs will need the mjs extension, and you will also need the full extension in the import. Eg:

import { defineConfig } from "cypress";
import { foo } from './foo.mjs' // mjs extension

export default defineConfig({
   e2e: {
      setupNodeEvents(on, config) {
        blah() // can call it here
        return config
      },
   },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.package manager: yarnIssues relating to yarn

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions