remarkjs / remark

markdown processor powered by plugins part of the @unifiedjs collective
https://remark.js.org
MIT License
7.66k stars 358 forks source link

TypeError: this.getData is not a function #1233

Closed AlexWayfer closed 1 year ago

AlexWayfer commented 1 year ago

Initial checklist

Affected packages and versions

Something indirect, probably new versions of remark-parse due to logs

Link to runnable example

No response

Steps to reproduce

I've received remark-cli and remark-gfm (doesn't matter I guess) from Depfu.

And I've noticed fails in Cirrus CI.

In this project were no fails in PRs, but they become after manual push to the main: https://cirrus-ci.com/task/6402074150174720?logs=lint#L12

In this project are fails in PRs: https://github.com/AlexWayfer/flame-sentry_context/pull/6

I had no errors locally, so I believe it depends on package-lock.json (and CI cache).

I've saved the old lock file: (oh, thanks GitHub, JSON files are too dangerous for you) package-lock.json.old.zip

And after npm update I've got the error locally, the package-lock.json is here: package-lock.json.zip

Node.js v20.7.0, npm v10.1.0 (there are no new versions in your issue template)

Expected behavior

No errors from indirect dependencies.

Actual behavior

There is error:

> remark -f .
CHANGELOG.md
: no issues found
LICENSE.md
: no issues found
README.md
error
Cannot process file
[cause]
:
    TypeError: this.getData is not a function
    at Object.exitCodeText (file:///tmp/cirrus-ci-build/node_modules/mdast-util-gfm-table/lib/index.js:121:12)
    at compile (file:///tmp/cirrus-ci-build/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:337:40)
    at fromMarkdown (file:///tmp/cirrus-ci-build/node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:173:27)
    at parser (file:///tmp/cirrus-ci-build/node_modules/remark-parse/lib/index.js:33:12)
    at Function.parse (file:///tmp/cirrus-ci-build/node_modules/unified/lib/index.js:668:12)
    at parse (file:///tmp/cirrus-ci-build/node_modules/unified-engine/lib/file-pipeline/parse.js:59:36)
    at wrapped (file:///tmp/cirrus-ci-build/node_modules/trough/index.js:115:27)
    at next (file:///tmp/cirrus-ci-build/node_modules/trough/index.js:65:23)
    at done (file:///tmp/cirrus-ci-build/node_modules/trough/index.js:148:7)
    at file:///tmp/cirrus-ci-build/node_modules/unified-engine/lib/file-pipeline/read.js:49:7

Runtime

Other (please specify in steps to reproduce)

Package manager

Other (please specify in steps to reproduce)

OS

Linux

Build and bundle tools

Other (please specify in steps to reproduce)

wooorm commented 1 year ago

Update both projects at the same time and it should work right now.

It takes time to go through the ecosystem. Wait a bit for the dust to settle :)

AlexWayfer commented 1 year ago

Nevermind, I've somehow messed up and there actually was remark-gfm v3, not v4. My bad, sorry.

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

wooorm commented 1 year ago

No worries! :)