Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting errors of the form "stryker error TS4023: Exported variable has or is using name from external module but cannot be named." #4472

Open
barrykaplan opened this issue Oct 7, 2023 · 0 comments
Labels
⁉ Question Further information is requested

Comments

@barrykaplan
Copy link

barrykaplan commented Oct 7, 2023

Question

I was first getting this error due the @szhsin/react-menu library. He has added some exports to resolve it. But that just unmasked the error for MUI components.

Is there any way around this other than pestering library maintainers to export more types?

Is is a specifiic error message


> reli.ui@0.0.0 test-mutate
> npx stryker run --ignoreStatic

07:32:43 (2191349) INFO ProjectReader Found 61 of 736 file(s) to be mutated.
07:32:43 (2191349) INFO Instrumenter Instrumented 61 source file(s) with 2017 mutant(s)
07:32:44 (2191349) INFO ConcurrencyTokenProvider Creating 16 checker process(es) and 15 test runner process(es).
07:32:56 (2191349) ERROR Stryker Unexpected error occurred while running Stryker StrykerError: Error: An error occurred during initialization of the "typescript" checker. Inner error: Error: Typescript error(s) found in dry run compilation: src/styles/components/StyledTree.tsx(4,7): error TS4023: Exported variable 'StyledTree' has or is using name 'DataGridProComponent' from external module "/home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@mui/x-data-grid-pro/DataGridPro/DataGridPro" but cannot be named.

Error: Typescript error(s) found in dry run compilation: src/styles/components/StyledTree.tsx(4,7): error TS4023: Exported variable 'StyledTree' has or is using name 'DataGridProComponent' from external module "/home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@mui/x-data-grid-pro/DataGridPro/DataGridPro" but cannot be named.

    at TypescriptChecker.init (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/typescript-checker/dist/src/typescript-checker.js:42:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async CheckerWorker.init (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/checker/checker-worker.js:11:17)
    at async ChildProcessProxyWorker.handleCall (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/child-proxy/child-process-proxy-worker.js:82:28)
Error: An error occurred during initialization of the "typescript" checker. Inner error: Error: Typescript error(s) found in dry run compilation: src/styles/components/StyledTree.tsx(4,7): error TS4023: Exported variable 'StyledTree' has or is using name 'DataGridProComponent' from external module "/home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@mui/x-data-grid-pro/DataGridPro/DataGridPro" but cannot be named.

Error: Typescript error(s) found in dry run compilation: src/styles/components/StyledTree.tsx(4,7): error TS4023: Exported variable 'StyledTree' has or is using name 'DataGridProComponent' from external module "/home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@mui/x-data-grid-pro/DataGridPro/DataGridPro" but cannot be named.

    at TypescriptChecker.init (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/typescript-checker/dist/src/typescript-checker.js:42:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async CheckerWorker.init (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/checker/checker-worker.js:11:17)
    at async ChildProcessProxyWorker.handleCall (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/child-proxy/child-process-proxy-worker.js:82:28)
    at CheckerWorker.init (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/checker/checker-worker.js:14:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ChildProcessProxyWorker.handleCall (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/child-proxy/child-process-proxy-worker.js:82:28)
    at ChildProcess.<anonymous> (file:///home/bkaplan/dev.hbk/reliasoft/reli.ui/node_modules/@stryker-mutator/core/dist/src/child-proxy/child-process-proxy.js:149:68)
    at ChildProcess.emit (node:events:513:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
  innerError: undefined
}
07:32:56 (2191349) INFO Stryker This might be a known problem with a solution documented in our troubleshooting guide.
07:32:56 (2191349) INFO Stryker You can find it at https://stryker-mutator.io/docs/stryker-js/troubleshooting/
07:32:56 (2191349) INFO Stryker Still having trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.

Process finished with exit code 1

Stryker environment

╰─ npm ls | grep stryker
├── @stryker-mutator/core@7.2.0
├── @stryker-mutator/typescript-checker@7.2.0
├── @stryker-mutator/vitest-runner@7.2.0

stryker.conf.json:

{
  "$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
  "testRunner": "vitest",
  "vitest": {
    "configFile": "vite.config.js"
  },
  "checkers": [
    "typescript"
  ],
  "tsconfigFile": "tsconfig.json",
  "typescriptChecker": {
    "prioritizePerformanceOverAccuracy": true
  },
  "reporters": [
    "progress",
    "html"
  ],
  "coverageAnalysis": "perTest",
  "ignorePatterns": [
    "src/styles/**"
  ]
}
@barrykaplan barrykaplan added the ⁉ Question Further information is requested label Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⁉ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant