Skip to content

Next.js + TS not working out of the box #27448

@lmiller1990

Description

@lmiller1990
npx create-next-app@latest
# pick a name
# you want typescript
# cd in
npm install cypress
npx cypress open

Choose CT

$ npx cypress open                                   (git)-[main]-
It looks like this is your first time using Cypress: 12.17.3

✔  Verified Cypress! /Users/lachlanmiller/Library/Caches/Cypress…

Opening Cypress...

DevTools listening on ws://127.0.0.1:64587/devtools/browser/2450b5e1-62a4-4a62-b9fc-2c24fc8c158c
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
/Users/lachlanmiller/Library/Caches/Cypress/12.17.3/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:311
        return new TSError(diagnosticText, diagnosticCodes, diagnostics);
               ^
TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.

I think we are not working with "moduleResolution": "bundler"

https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#moduleresolution-bundler

Probably related: #26308

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions