Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

TypeError: Cannot read property 'visitClass' of undefined #243

Closed
dan-gamble opened this issue Feb 1, 2016 · 65 comments
Closed

TypeError: Cannot read property 'visitClass' of undefined #243

dan-gamble opened this issue Feb 1, 2016 · 65 comments

Comments

@dan-gamble
Copy link

hzoo here just adding: this is fixed the latest 2 versions (update your babel-eslint).

npm i babel-eslint will be >= 4.1.7.

Use npm install --save-dev babel-eslint@next or npm i babel-eslint@5.0.0-beta9

escope updated to babel 6

Eslint version: 1.4.1, 1.10.3
babel-eslint: 4.1.4

The error:

TypeError: Cannot read property 'visitClass' of undefined
    at monkeypatch (/usr/local/lib/node_modules/babel-eslint/index.js:201:40)
    at Object.exports.parse (/usr/local/lib/node_modules/babel-eslint/index.js:374:5)
    at parse (/usr/local/lib/node_modules/eslint/lib/eslint.js:539:27)
    at EventEmitter.module.exports.api.verify (/usr/local/lib/node_modules/eslint/lib/eslint.js:663:19)
    at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:220:27)
    at processFile (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:257:18)
    at executeOnFile (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:600:23)
    at /usr/local/lib/node_modules/eslint/lib/cli-engine.js:624:17
    at Array.forEach (native)
    at CLIEngine.executeOnFiles (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:622:18)

No matter what path i give eslint (eslint *.js, eslint androgenix/assets/js/**/*.js) i get this error. Not sure where to start looking to fix this. Our old projects seem to work okay but we just started this one and are receiving this error.

@Havunen
Copy link

Havunen commented Feb 1, 2016

same issue.

@chromakode
Copy link

This appears to be an incompatibility with the recently released escope 3.4.0. Downgrading to 3.3.0 resolved this issue for me.

@riffraff
Copy link

riffraff commented Feb 1, 2016

we are also seeing this as of a couple hours ago, with cli eslint jsdir -f html -o eslint/eslint.html

@dan-gamble
Copy link
Author

@chromakode How do you go about downgrading a packages escope package?

@Havunen
Copy link

Havunen commented Feb 1, 2016

npm install --save-dev escope@3.3.0 fixes issue

@dan-gamble
Copy link
Author

@Havunen I'm still getting the same issue when trying that, tried installing locally and globally (I run eslint off of -g)

@Havunen
Copy link

Havunen commented Feb 1, 2016

but thats definitely a work around as my project has no direct dependency to escope

@dan-gamble strange, I just did what @chromakode suggested and it worked for me.

@chromakode
Copy link

@dan-gamble You may still have a copy of escope 3.4.0 under node_modules/eslint/node_modules/escope that is being used. Check npm ls | grep escope to list your installed versions, and rm -r any if necessary.

@mathew-kurian
Copy link

+1

1 similar comment
@stevesims
Copy link

+1

@indeyets
Copy link

indeyets commented Feb 1, 2016

Upstream issue: estools/escope#99

@mattdell
Copy link

mattdell commented Feb 1, 2016

+1 to @Havunen

Edit, actually that didn't help after I cleared node_modules and ran again. I've had to disable eslint in my project as a result.

@felipenehmi
Copy link

+1

@brenopolanski
Copy link

+1

1 similar comment
@rafaferreira
Copy link

+1

doktordirk added a commit to doktordirk/aurelia-api that referenced this issue Feb 1, 2016
noseglid added a commit to noseglid/atom-build that referenced this issue Feb 1, 2016
This is an issue with escope which is a dependency for
babel-eslint. See babel/babel-eslint#243
for more info
@jwilander
Copy link

+1

instructure-gerrit pushed a commit to instructure/instructure-ui that referenced this issue Feb 1, 2016
Note: added escope dev dependency to fix this issue:

babel/babel-eslint#243

Change-Id: Id866c24b831b9e0fe156e53993538cbbd48acd17
Reviewed-on: https://gerrit.instructure.com/71189
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Jennifer Stern <jstern@instructure.com>
lprajus2007 added a commit to lprajus2007/babel-eslint that referenced this issue Feb 1, 2016
@lprajus2007
Copy link

Guys you can use my fork of @christophehurpeau's fix to install babel-eslint for now (if you're in need of a urgent fix just like me)

npm install git://github.com/lprajus2007/babel-eslint

@developit
Copy link
Member

@lprajus2007 tip: npm install lprajus2007/babel-eslint

zordius pushed a commit to zordius/gulp-jsx-coverage that referenced this issue Mar 18, 2016
jimf added a commit to jimf/redux-actions that referenced this issue Apr 4, 2016
Conservative version bump to fix
babel/babel-eslint#243 which was breaking the
build.
tmeasday added a commit to meteor/meteor that referenced this issue May 25, 2016
andrew-codes pushed a commit to versionone/VersionOne.SDK.JavaScript that referenced this issue Jun 6, 2016
Hippoom added a commit to Hippoom/kibana-guard-plugin that referenced this issue Jun 17, 2016
@cchamberlain
Copy link

@dan-gamble - Late to the game but I noticed your question on how to change a global packages dependency. The one-liner is npm explore eslint -g -- npm i escope@3.3.0 in case you need to do that again. Sort of documented here => https://github.com/nodejs/node-gyp/wiki/Updating-npm's-bundled-node-gyp

yomexzo pushed a commit to Shopify/js-buy-sdk that referenced this issue Aug 22, 2016
emflores added a commit to emflores/navigo that referenced this issue Sep 19, 2016
emflores added a commit to emflores/navigo that referenced this issue Sep 19, 2016
babel-eslint -> devDep

revert dep prop deletion
mikkoh pushed a commit to Shopify/js-buy-sdk that referenced this issue Oct 12, 2016
kenfehling added a commit to kenfehling/react-router-apply-middleware that referenced this issue Oct 30, 2016
To fix this issue (when running `npm test`): babel/babel-eslint#243
kenfehling added a commit to kenfehling/react-router-apply-middleware that referenced this issue Oct 30, 2016
To fix this issue (when running `npm test`): babel/babel-eslint#243
natoverse added a commit to atsid/badger that referenced this issue Dec 28, 2016
- builds did't work completely due to a transitive dependency in older
version of babel-eslint
(babel/babel-eslint#243)
- fixed some lint issues from the debug lib removal that were masked by
build issue
plbecker pushed a commit to plbecker/numenta-apps that referenced this issue May 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests