question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing error: visit is not a function

See original GitHub issue

Initial checklist

Affected packages and versions

2.0.0

Link to runnable example

No response

Steps to reproduce

The following sample file fails to lint:

---
title: "Summer Duran"
type: art
draft: false
created: "2021-05-28"
---

<SummerDuran1 />

eslint config:

"eslintConfig": {
    "parser": "@typescript-eslint/parser",
    "plugins": [
      "@typescript-eslint"
    ],
    "extends": [
      "eslint:recommended",
      "plugin:react/recommended",
      "plugin:@typescript-eslint/recommended",
      "plugin:react-hooks/recommended",
      "prettier"
    ],
    "overrides": [
      {
        "files": [
          "*.mdx"
        ],
        "extends": [
          "plugin:mdx/recommended"
        ],
        "globals": {
          "AwesomeCutScenes": "readonly"
        },
        "rules": {
          "react/jsx-no-undef": [
            2,
            {
              "allowGlobals": true
            }
          ]
        }
      }
    ],
    "env": {
      "es6": true,
      "browser": true,
      "jest": true,
      "node": true
    },
    "rules": {
      "react/react-in-jsx-scope": 0,
      "react/display-name": 0,
      "react/prop-types": 0,
      "@typescript-eslint/explicit-function-return-type": 0,
      "@typescript-eslint/explicit-module-boundary-types": 0,
      "@typescript-eslint/explicit-member-accessibility": 0,
      "@typescript-eslint/indent": 0,
      "@typescript-eslint/member-delimiter-style": 0,
      "@typescript-eslint/no-explicit-any": 0,
      "@typescript-eslint/no-var-requires": 0,
      "@typescript-eslint/no-use-before-define": 0,
      "@typescript-eslint/no-unused-vars": [
        2,
        {
          "argsIgnorePattern": "^_"
        }
      ],
      "no-console": [
        2,
        {
          "allow": [
            "warn",
            "error"
          ]
        }
      ]
    },
    "settings": {
      "react": {
        "version": "detect"
      }
    }
  },

Expected behavior

  • should lint
  • but upgrading to eslint 8.X breaks the MDX parser

Actual behavior

  • the above error

environment

"eslint": "8.18.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-mdx": "2.0.0",
    "eslint-plugin-react": "7.21.5",
    "eslint-plugin-react-hooks": "4.6.0",

Runtime

Node v16

Package manager

yarn v1

OS

macOS

Build and bundle tools

Next.js

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
JounQincommented, Jun 28, 2022

What’s the workaround @JounQin ? When I try to install vifile, yarn says that package doesn’t exist 😃

Update: BTW, when I yarn install the build, still getting the same error.

Sorry, it’s vfile.

And a new temporary fixed version of eslint-plugin-mdx is

yarn add https://pkg.csb.dev/mdx-js/eslint-mdx/commit/98013f6e/eslint-plugin-mdx

See https://ci.codesandbox.io/status/mdx-js/eslint-mdx/pr/405/builds/265745 for more installation details for other npm clients.

1reaction
Manubicommented, Jun 27, 2022

I do get the same error: Parsing error: visit is not a function eslint CleanShot 2022-06-27 at 15 12 10@2x

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing error: parser.parse is not a function #512 - GitHub
On codeclimate.com the PR is failing but the only error message shown on the site is Parsing error: parser.parse is not a function...
Read more >
meteor - ESLint React Parsing Error - Stack Overflow
It works fine until I try and use React. main.js: Meteor.startup(() => { render(<App ...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
Help! Now getting 'Parsing Error "" is not a function' on all ...
I've been working on debugging this, non-stop for the past week, searching issues, forums, etc.
Read more >
ESLint@8.23: TypeError: this.libOptions.parse is not a function
Upon lint a file, ESLint failed with the following error: this.libOptions.parse is not a function 3. I use tabs instead of spaces, in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found