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

`TypeError: this[statement.type] is not a function` #199

Closed dividedmind closed 1 year ago

dividedmind commented 1 year ago

I got the following error trying to map @appland/models as of a41b670ae170303cc46f74a2d6afb535eaa9dbd9:

FAIL  tests/unit/appMapFilter.spec.js
  ● Test suite failed to run

    TypeError: this[statement.type] is not a function

      at Object.BlockStatement (file:/home/divide/projects/appmap-js/node_modules/astring/dist/astring.mjs:286:29)
      at Object.ClassDeclaration (file:/home/divide/projects/appmap-js/node_modules/astring/dist/astring.mjs:529:10)
      at Object.Program (file:/home/divide/projects/appmap-js/node_modules/astring/dist/astring.mjs:261:27)
      at generate (file:/home/divide/projects/appmap-js/node_modules/astring/dist/astring.mjs:1178:29)
      at instrument$2 (file:/home/divide/projects/appmap-js/node_modules/@appland/appmap-agent-js/dist/bundles/transformer-jest.mjs:2726:18)
      at instrument$1 (file:/home/divide/projects/appmap-js/node_modules/@appland/appmap-agent-js/dist/bundles/transformer-jest.mjs:2808:37)
      at instrument (file:/home/divide/projects/appmap-js/node_modules/@appland/appmap-agent-js/dist/bundles/transformer-jest.mjs:3089:55)
      at transform (file:/home/divide/projects/appmap-js/node_modules/@appland/appmap-agent-js/dist/bundles/transformer-jest.mjs:3176:13)
      at processAsync (file:/home/divide/projects/appmap-js/node_modules/@appland/appmap-agent-js/dist/bundles/transformer-jest.mjs:3239:16)
      at ScriptTransformer.transformSourceAsync (../../node_modules/@jest/transform/build/ScriptTransformer.js:676:25)
dividedmind commented 1 year ago

I tracked it down to @babel/parser emitting ClassProperty instead of the standard PropertyDefinition. It seems its estree plugin is misconfigured; investigating.

appland-release commented 1 year ago

:tada: This issue has been resolved in version 13.5.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: