cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.02k stars 3.19k forks source link

ERROR TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'. #30016

Closed nichoth closed 1 month ago

nichoth commented 3 months ago

Current behavior

Start cypress in a new project, follow the GUI prompts, choose e2e testing, run the first example test, todo, and it prints an error.

image
Error: Webpack Compilation Error
[tsl] ERROR
      TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.

[tsl] ERROR
      TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.

Desired behavior

Should run a test

Test code to reproduce

https://github.com/nichoth/example-cypress

Cypress Version

13.13.2

Node version

v20.11.1

Operating System

macOS 14.5

Debug Logs

Error: Webpack Compilation Error
[tsl] ERROR
      TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.

[tsl] ERROR
      TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
    at Watching.handle [as handler] (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:212:23)
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:303:9
    at Hook.eval [as callAsync] (eval at create (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
    at Watching._done (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:299:28)
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:213:21
    at Compiler.emitRecords (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:919:5)
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:191:22
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:885:14
    at Hook.eval [as callAsync] (eval at create (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:882:27
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
    at done (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
    at alreadyWritten (/Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:714:8)
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:802:19
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at /Users/nick/Library/Caches/Cypress/13.13.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)

Other

No response

lucaslosi commented 3 months ago

same issue here.

I've pinned it down to the typescript version 5.5.4 . "typescript": "5.5.3" works fine.

here is my tsconfig if anyone want do look in to it:

{
    "$schema": "https://json.schemastore.org/tsconfig",
    "compilerOptions": {
        "baseUrl": ".",
        "allowJs": true,
        "composite": false,
        "declaration": true,
        "declarationMap": true,
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "incremental": true,
        "inlineSources": false,
        "isolatedModules": true,
        "module": "ESNext",
        "moduleResolution": "node",
        "noEmit": true,
        "noUnusedLocals": false,
        "noUnusedParameters": false,
        "preserveWatchOutput": true,
        "removeComments": true,
        "resolveJsonModule": true,
        "skipLibCheck": true,
        "sourceMap": false,
        "strict": false,
        "target": "es2021",
        "types": ["cypress"]
    },
    "display": "Default",
    "exclude": ["node_modules", "node"]
}
khitrenovich commented 3 months ago

Same here, the error appears on Renovate bump of TS from 5.5.3 to 5.5.4

spacedawwwg commented 1 month ago

Any movement on this? seems strange to have to lock in at 5.5.3

mschile commented 1 month ago

Hi @nichoth 👋, I was able to reproduce the issue using typescript 5.5.4. However, the issue appears to be resolved with typescript 5.6.2. Could you (or anyone else) verify that they are also seeing the issue resolved with typescript 5.6.2. Thanks!

lucaslosi commented 1 month ago

here it's working on the latest version (5.6.2) with the same tsconfig that had errors with 5.5.4. I think you can close this.

Thanks