Skip to content

Scaffolded project with "tsc --init" + "type": "module" fails to compile due to conflicting module/commonjs Β #27359

@JessicaSachs

Description

@JessicaSachs

Current behavior

image

Desired behavior

Better error message. Something like the below

"The module type in your `tsconfig.json` doesn't match the one in your `package.json`. Either choose `commonjs` or `module`"

Test code to reproduce

npm init -y
pnpm install cypress typescript -D
pnpm tsc --init
pnpm cypress open

Change package.json to use "type": "module" (the default for tsc is commonjs)

Cypress Version

Any >= 10. Currently 12.X

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions