getappmap / appmap-agent-js

This project is deprecated. Please use https://github.com/getappmap/appmap-node/ to record Node.js applications.
Other
28 stars 8 forks source link

Recommended record command results in error "TypeError: this._environment.runScript is not a function" #165

Closed kgilpin closed 1 year ago

kgilpin commented 1 year ago
➜  sequence-diagram git:(feat/seq-diagram-diff-text) ✗ npx @appland/appmap-agent-js -- jest              

(node:16544) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
 FAIL  tests/unit/http.spec.ts
  ● Test suite failed to run

    TypeError: this._environment.runScript is not a function

      at Runtime._execModule (../../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-runtime/build/index.js:733:41)
lachrist commented 1 year ago

Apparently this is caused by a clash of jest version. Could it be that your system is running different jest version? Anyhow, I will also try to reproduce this tomorrow.

lachrist commented 1 year ago

As for the previous issue, you are running the globally installed jest. You want to use the locally installed jest with npx jest, yarn exec jest or yarn run test. Only the first one is actually recognized as a jest command and it causes https://github.com/getappmap/appmap-agent-js/issues/167.