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

Fails To Run For TypeScript Express Project #56

Open
JimLynchCodes opened this issue Jul 30, 2023 · 0 comments
Open

Fails To Run For TypeScript Express Project #56

JimLynchCodes opened this issue Jul 30, 2023 · 0 comments

Comments

@JimLynchCodes
Copy link

I have a public repo here that is a simple ExpressJS NodeJs project in TypeScript which uses Jest for unit tests.

When I run npx stryker run --fileLogLevel trace --logLevel debug though I get this output and error:

16:23:03 (41154) INFO ConfigReader Using stryker.conf.js in the current working directory.
16:23:03 (41154) DEBUG ConfigReader Loading config stryker.conf.js
16:23:03 (41154) DEBUG PluginLoader Loading stryker-* from /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules
16:23:03 (41154) DEBUG PluginLoader Expression stryker-* not resulted in plugins to load
16:23:03 (41154) DEBUG PluginLoader Loading plugins /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/reporters/index.js
16:23:03 (41154) DEBUG PluginLoader Loading plugins /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/mutators/index.js
16:23:03 (41154) DEBUG BroadcastReporter Broadcasting to reporters ["clear-text","progress"]
16:23:03 (41154) INFO InputFileResolver Found 3 of 11 file(s) to be mutated.
16:23:03 (41154) DEBUG InputFileResolver All input files: [
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/jest.config.js",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/package-lock.json",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/package.json",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/app.ts",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.test.ts",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.ts",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/stryker.conf.js",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/tsconfig.json",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/.gitignore",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/LICENSE",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/README.md"
]
16:23:03 (41154) DEBUG InputFileResolver Files to mutate: [
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/app.ts",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.test.ts",
  "/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.ts"
]
16:23:03 (41154) WARN TestFrameworkOrchestrator Missing config settings `testFramework`. Set `coverageAnalysis` option explicitly to "off" to ignore this warning.
16:23:03 (41154) ERROR StrykerCli an error occurred Exception [Error]: Could not inject "InitialTestExecutor". Inner error: Could not inject "TranspilerFacade". Inner error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
    at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:35:19)
    at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
    at Stryker.<anonymous> (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/Stryker.js:75:30)
    at step (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:133:27)
    at Object.next (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:114:57)
    at fulfilled (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:104:62) {
  innerError: Exception [Error]: Could not inject "TranspilerFacade". Inner error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
      at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:35:19)
      at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
      at ClassProvider.result (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:173:21)
      at ClassProvider.resolveInternal (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:131:36)
      at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:56:33
      at Array.map (<anonymous>)
      at ClassProvider.resolveParametersToInject (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:49:23)
      at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:31:31)
      at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
      at Stryker.<anonymous> (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/Stryker.js:75:30) {
    innerError: Error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
        at PluginLoader.resolve (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/di/PluginLoader.js:40:19)
        at PluginCreator.create (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/di/PluginCreator.js:11:42)
        at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/transpiler/TranspilerFacade.js:17:103
        at Array.map (<anonymous>)
        at new TranspilerFacade (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/transpiler/TranspilerFacade.js:17:14)
        at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:32:20)
        at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
        at ClassProvider.result (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:173:21)
        at ClassProvider.resolveInternal (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:131:36)
        at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:56:33
  }
}

I thought I should have all the necessary things installed already since I followed all the documentation and have these three striker dev dependencies installed in my package.json file:

{
  "name": "mtdd-typescript-nodejs-example",
  "version": "1.0.0",
  "description": "from the live stream!",
  "main": "index.js",
  "scripts": {
    "start": "node dist/app.js",
    "build": "tsc",
    "test": "jest",
    "test:cov": "jest --coverage",
    "mtdd": "stryker run"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/express": "^4.17.17",
    "express": "^4.18.2"
  },
  "devDependencies": {
    "@stryker-mutator/typescript": "^4.0.0",
    "@types/jest": "^29.5.3",
    "jest": "^29.6.2",
    "stryker": "^0.35.1",
    "stryker-api": "^0.24.1",
    "ts-jest": "^29.1.1",
    "typescript": "^5.1.6"
  }
}

Am I doing something wrong here? Anyone see how I can get stryker running properly in this project? Thanks!

PS. I am using node v18.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant