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

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

Projects

None yet
@dan-gamble

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
Havunen commented Feb 1, 2016

same issue.

@chromakode

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
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

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

@Havunen
Havunen commented Feb 1, 2016

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

@dan-gamble

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

@Havunen
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

@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.

@bluejamesbond

+1

@stevesims

+1

@thetalecrafter thetalecrafter referenced this issue in eslint/eslint Feb 1, 2016
Closed

error linting es6 #5125

@indeyets
indeyets commented Feb 1, 2016

Upstream issue: estools/escope#99

@mattdell
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

+1

@gaearon gaearon referenced this issue in michaelcontento/redux-storage Feb 1, 2016
Closed

redux@3.2.0 breaks build 🚨 #86

@brenopolanski

+1

@rafaferreira

+1

@doktordirk doktordirk added a commit to doktordirk/aurelia-api that referenced this issue Feb 1, 2016
@doktordirk doktordirk chore(lint): fix eslint issue babel/babel-eslint#243 090a2cd
@noseglid noseglid added a commit to noseglid/atom-build that referenced this issue Feb 1, 2016
@noseglid noseglid Fixed linting issue
This is an issue with escope which is a dependency for
babel-eslint. See babel/babel-eslint#243
for more info
b957dbb
@jwilander

+1

@instructure-gerrit instructure-gerrit pushed a commit to instructure/instructure-ui that referenced this issue Feb 1, 2016
@junyper junyper Upgrade dependencies
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>
1018728
@job13er job13er added a commit to job13er/eslint-config-frost-standard that referenced this issue Feb 1, 2016
@job13er job13er Pinning some versions b/c of bugs 605123c
@jcreamer898 jcreamer898 added a commit to lonelyplanet/rizzo-next that referenced this issue Feb 1, 2016
@jcreamer898 jcreamer898 TEMPORARY FIX
There is an issue with babel-eslint breaking all builds.

babel/babel-eslint#243

Will turn it back on once the issue is fixed.
929f646
@lprajus2007

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

@lprajus2007 tip: npm install lprajus2007/babel-eslint

@jmeas
Member
jmeas commented Feb 1, 2016

Thanks for the fork @lprajus2007 ! I'm going to use that for now.

@jtheoof
jtheoof commented Feb 1, 2016

Thanks @lprajus2007 doing the same until this issue is fixed.

@pbeets
pbeets commented Feb 1, 2016

@lprajus2007 works for me, thanks.

@hzoo
Member
hzoo commented Feb 1, 2016

I can push on a fix soon (#244). Sounds like I need to do it for 4.x and 5.x beta?

@hzoo hzoo referenced this issue in estools/escope Feb 1, 2016
Closed

3.4.0 breaks babel-eslint #99

@developit

@hzoo yes, this is broken for both

@hzoo hzoo pushed a commit that closed this issue Feb 1, 2016
@christophehurpeau christophehurpeau fix #243 d8ac8f9
@hzoo hzoo closed this in d8ac8f9 Feb 1, 2016
@jmeas
Member
jmeas commented Feb 1, 2016

Sounds like I need to do it for 4.x and 5.x beta?

Yup. And thanks for the quick fix!

@hzoo
Member
hzoo commented Feb 1, 2016

Published babel-eslint@5.0.0-beta9

I will move babel-eslint@5.0.0-beta9 to the next tag for npm. and make a new version for babel-eslint 4.

@likai757 likai757 pushed a commit to likai757/nuka-carousel that referenced this issue Feb 1, 2016
Kai.Li fix visitClass of undefined :babel/babel-eslint#243 e53ca41
@htomaka
htomaka commented Feb 1, 2016

Downgrading to escope 3.3.0 worked for me. Thx

@jtheoof
jtheoof commented Feb 1, 2016

Thanks @hzoo can you put an update here when you release 4.1.7?

@htomaka htomaka pushed a commit to htomaka/ng-starter that referenced this issue Feb 1, 2016
tomaka FIX - babel-eslint dependency issue see: babel/babel-eslint#243 96049e3
@hzoo
Member
hzoo commented Feb 1, 2016

Ok both are published - let me know if it's good.

npm view babel-eslint dist-tags

{ latest: '4.1.7', next: '5.0.0-beta9' }

@rrdelaney

👍 4.1.7 fixed the issue for me

@hledley hledley referenced this issue in seatgeek/react-infinite Feb 1, 2016
Merged

Allow other overflowY values on root div #130

@spalger spalger added a commit to spalger/kibana that referenced this issue Feb 1, 2016
@spalger spalger [npm] upgrade babel-eslint to fix babel/babel-eslint#243 a39a07c
@spalger spalger referenced this issue in elastic/kibana Feb 1, 2016
Merged

[npm] upgrade babel-eslint #6060

@jtheoof
jtheoof commented Feb 1, 2016

👍 Same here. Thanks.

@jwilander

4.1.7 fix worked for me, thanks!

@skrobek
skrobek commented Feb 1, 2016

Same here, 4.1.7 fixed the problem 👍

@elasticsearch-bot elasticsearch-bot pushed a commit to elastic/kibana that referenced this issue Feb 1, 2016
@spalger @spalger spalger + spalger upgrade babel-eslint to fix babel/babel-eslint#243
Fixes #6060
0fa7c90
@elasticsearch-bot elasticsearch-bot pushed a commit to elastic/kibana that referenced this issue Feb 1, 2016
@spalger @spalger spalger + spalger upgrade babel-eslint to fix babel/babel-eslint#243
Fixes #6060
e5615c9
@elasticsearch-bot elasticsearch-bot pushed a commit to elastic/kibana that referenced this issue Feb 1, 2016
@spalger @spalger spalger + spalger upgrade babel-eslint to fix babel/babel-eslint#243
Fixes #6060
33c6c5b
@mridgway mridgway referenced this issue in mridgway/hoist-non-react-statics Feb 1, 2016
Merged

Fail-safe when target property cannot be written to (fixes #7) #9

@fkrauthan

5.0.0-beta9 is not available via NPM

@hzoo
Member
hzoo commented Feb 1, 2016

@fkrauthan I moved it to be on the next tag.

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

@fkrauthan

Yeah but I get the following error message:

npm ERR! No compatible version found: babel-eslint@5.0.0-beta9
npm ERR! Valid install targets:
npm ERR! 5.0.0-beta8, 5.0.0-beta7, 5.0.0-beta6, 5.0.0-beta5, 5.0.0-beta4, 5.0.0-beta3, 5.0.0-beta2, 5.0.0-beta1, 4.1.6, 4.1.5, 4.1.4, 4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.0.10, 4.0.9, 4.0.8, 4.0.7, 4.0.6, 4.0.5, 4.0.4, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 3.1.30, 3.1.29, 3.1.28, 3.1.27, 3.1.26, 3.1.25, 3.1.24, 3.1.23, 3.1.22, 3.1.21, 3.1.20, 3.1.19, 3.1.18, 3.1.17, 3.1.16, 3.1.15, 3.1.14, 3.1.13, 3.1.12, 3.1.11, 3.1.10, 3.1.9, 3.1.8, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.1.3, 3.1.1, 3.1.0, 3.0.1, 3.0.0, 2.0.2, 2.0.0, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0
@emmenko
emmenko commented Feb 1, 2016

4.1.7 works for me too. Thanks for the quick fix! 👍

@dschafer dschafer referenced this issue in graphql/graphql-js Feb 1, 2016
Merged

[easy] Bump babel-eslint version #283

@hzoo
Member
hzoo commented Feb 1, 2016

@fkrauthan that is really weird. babel-eslint@5.0.0-beta9 is definitely showing up for me and is there when I do npm view babel-eslint. If I do npm i babel-eslint@5.0.0-beta10 (not created), I can see beta9 in the valid install targets

@fkrauthan

Hmm maybe a caching issue and it needs a bit more time until it shows up for me?

@tofumatt tofumatt referenced this issue in mozilla/dispensary Feb 1, 2016
Merged

Improve test coverage #36

@lscheinkman lscheinkman added a commit to lscheinkman/numenta-apps that referenced this issue Feb 1, 2016
@lscheinkman lscheinkman Temporary fix for eslint's dependency. See babel/babel-eslint#243 8679fff
@bdefore
bdefore commented Feb 1, 2016

@fkrauthan i was able to install beta9. i usually use the min-cache=1000000 trick for speeding up installs, but in this case i had to install without it or it did not find it.

@fkrauthan

@bdefore My bad. Our artifcatory server was caching npm requests. Just cleared the artifactory cache and it was able to pull beta9

@ghost Unknown added a commit to facebook/nuclide that referenced this issue Feb 2, 2016
@matthewwithanm matthewwithanm + facebook-github-bot-6 Upgrade babel-eslint
Summary:
An incompatibility with escope 3.4.0 was causing an error when linting.
See <babel/babel-eslint#243>

public

Reviewed By: nmote

Differential Revision: D2888279

fb-gh-sync-id: 41ff47eb3c8eee40cda586126494e5aba7213a2e
92ac5dc
@c0debreaker

The solution given above npm install --save-dev escope@3.3.0 also worked for me.

However, on my teammate's setup, it didn't work until I found grunt-eslint also had escope. Told him to uninstall grunt-eslint and reinstall. When I did a cat package.json again on his grunt-eslint, escope is gone. Our app finally worked on his machine.

What is the final solution? Definitely we don't want to go inside each node_modules and installing this kind of fix.

@hzoo
Member
hzoo commented Feb 2, 2016

@c0debreaker did you see my post above? #243 (comment)

I pushed a new release of babel-eslint on both 4.x and 5.x so just update that and you should be good.

@klimashkin

@hzoo Did you republish beta9? Because we have the same problem with our artifactory - cached beta9 but it's broken!
Maybe you can update to beta10? We can't use eslint because of that whole day

@fkrauthan

@klimashkin Just log into the webinterface of your artifcatory, remove the broken package/invalidate the cache and you should be fine

@klimashkin

@fkrauthan I got it, but it's a really bad practice and it should be done by many many consumers

@fkrauthan

@klimashkin I never got a bad package. My problem was just that artifcatory wasn't contacting npm because of the internal cache timeout. Not much @hzoo can do against that.

@klimashkin

@hzoo can raise version

@fkrauthan

he did with beta9 which is fine and which was raised from original beta8.

@KeefKalif KeefKalif pushed a commit to KeefKalif/starhackit that referenced this issue Feb 5, 2016
KeefKalif Update babel-eslint
npm install failed for me
babel/babel-eslint#243
f434c22
@lencioni lencioni added a commit to lencioni/eslint-plugin-react that referenced this issue Feb 5, 2016
@lencioni lencioni Update babel-eslint 5.0.0-beta6 -> 5.0.0-beta10
The current version gives me the following error when I try to run tests
on master:

> TypeError: Cannot read property 'visitClass' of undefined

It looks like this has since been resolved by the related packages, so
we can avoid this problem by bumping versions.

More info: babel/babel-eslint#243
9bfbe82
@phorust phorust added a commit to Goodly/annotator-content-analysis that referenced this issue Feb 10, 2016
@phorust phorust patch deps so dev server works again
babel-eslint 4.1.6 had a problem: babel/babel-eslint#243
0ca157c
@calvinl calvinl referenced this issue in combine/universal-react-redux Feb 11, 2016
Closed

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

@randycoulman randycoulman added a commit to CodingZeal/eslint-config-zeal that referenced this issue Feb 12, 2016
@randycoulman randycoulman Update babel-eslint dependency
We need at least babel-eslint 4.1.7 in order to fix
babel/babel-eslint#243.
1286f97
@ryanspradlin ryanspradlin referenced this issue in facebook/dataloader Feb 13, 2016
Merged

Implement ability to directly prime the cache #18

@ryanspradlin ryanspradlin pushed a commit to ryanspradlin/dataloader that referenced this issue Feb 13, 2016
Ryan Spradlin Upgrade babel-eslint to 4.1.8 in order to avoid 048fd48
@ryanspradlin ryanspradlin referenced this issue in facebook/dataloader Feb 13, 2016
Merged

Upgrade babel-eslint dependency #19

@mziwisky mziwisky added a commit to mziwisky/rackt-cli that referenced this issue Feb 14, 2016
@mziwisky mziwisky upgrade dependency babel-eslint 80a24d5
@mziwisky mziwisky referenced this issue in mzabriskie/rackt-cli Feb 14, 2016
Merged

upgrade dependency babel-eslint #24

@DavidKlassen DavidKlassen added a commit to DavidKlassen/es6-browser-boilerplate that referenced this issue Feb 15, 2016
@DavidKlassen DavidKlassen Upgraded babel-eslint to ^4.1.8 to fix babel/babel-eslint#243 8583d4e
@nuc nuc added a commit to moviepilot/react-helmet that referenced this issue Feb 15, 2016
@nuc nuc Update babel-eslint 3a5e903
@sammcj sammcj pushed a commit to ask-izzy/ask-izzy that referenced this issue Feb 16, 2016
Josh Crompton Bump babel-eslint version
See babel/babel-eslint#243 for details
of the bug/fix.
d92087c
@hzoo hzoo referenced this issue in godaddy/javascript Feb 16, 2016
Merged

[major] update dependencies and eslint config #5

@scarletsky

Same issue here with eslint 2.1.0 and babel-eslint 5.0.0.
I also try babel-eslint 4.1.8, but it do not work.

@winkler1 winkler1 added a commit to winkler1/flow-eslint-react-demo that referenced this issue Feb 19, 2016
@winkler1 winkler1 Work around babel/babel-eslint#243. 279d2ca
@JisuPark JisuPark referenced this issue in krasimir/webpack-library-starter Feb 23, 2016
Merged

Update babel-eslint library version to avoid TypeError #2

@gusvargas gusvargas pushed a commit to gusvargas/redux-actions that referenced this issue Feb 23, 2016
Gus Vargas Update babel-eslint to fix build error. 057765b
@minasmart minasmart added a commit to Shopify/js-buy-sdk that referenced this issue Feb 25, 2016
@minasmart minasmart attempt to fix weird eslint build error. b9a7dfc
@wezleytsai wezleytsai referenced this issue in drdelambre/drdelambre Mar 3, 2016
Merged

fix aborted xhr json error #4

@timc13 timc13 added a commit to timc13/js-data-angular that referenced this issue Mar 10, 2016
@timc13 timc13 upgrade babel-eslint to fix TypeError c4e2975
@timc13 timc13 referenced this issue in js-data/js-data-angular Mar 10, 2016
Merged

upgrade babel-eslint to fix TypeError #354

@frozenfung

4.1.7 works for me. Thanks! 👍

@radu-arimatrix
├─┬ babel-eslint@5.0.0-beta9
│ └── acorn-to-esprima@2.0.8
└── eslint@2.4.0

Still have this issue:

TypeError: Cannot read property 'visitClass' of undefined
    at monkeypatch (/Users/username/Repos/Application/node_modules/babel-eslint/index.js:201:40)

Can I at least set it to warn?

@balaurzor

maybe you want to update your eslint seing that you are using 5.0 beta9 and the stable version is out

@radu-arimatrix

Using npm install eslint@2.x babel-eslint@next(to get the latest versions) I get the exact same error.

├── babel-eslint@6.0.0-beta.6
└── eslint@2.4.0
TypeError: Cannot read property 'visitClass' of undefined
    at monkeypatch (/Users/rtanasescu/Repos/arilove-fe/node_modules/babel-eslint/index.js:201:40)

I've even tried to use $ npm install eslint@1.x babel-eslint --save-dev, same thing.

I'm working on a react app, with "babel": "5.8.23".

Is there an option in the configuration file that I could disable? (I don't mind a bit of missing functionality, it's better than no functionality)

@Arcanemagus

@radu-arimatrix You need to be on babel-eslint@^6.0.0 for support of eslint@^2.3.0. (Technically for eslint@^2.0.0, but it "sortof" worked in versions before v2.3.0)

@radu-arimatrix
├── babel@6.0.0
└── eslint@2.3.0
TypeError: Cannot read property 'visitClass' of undefined
    at monkeypatch (/Users/rtanasescu/Repos/arilove-fe/node_modules/babel-eslint/index.js:201:40)

No, still the same error. Thank you to who has invited me to the slack group for the React Program, I'll try to get help there :)

I'm trying to do this with Sublime, would Atom work better?

@zordius zordius added a commit to zordius/gulp-jsx-coverage that referenced this issue Mar 18, 2016
@zordius zordius move to babel-eslint 4.1.7 to fix build failed (refer to babel/babel-… 7e57b7e
@jimf jimf added a commit to jimf/redux-actions that referenced this issue Apr 4, 2016
@jimf jimf Bump babel-eslint dev dependency
Conservative version bump to fix
babel/babel-eslint#243 which was breaking the
build.
bfd0c6e
@tmeasday tmeasday added a commit to meteor/meteor that referenced this issue May 25, 2016
@tmeasday tmeasday Bump babel-eslint version in the linter
To work around babel/babel-eslint#243
36e14e7
@andrew-codes andrew-codes added a commit to versionone/VersionOne.SDK.JavaScript that referenced this issue Jun 6, 2016
@andrew-codes andrew-codes Fix an issue with a newer version of this dependency for babel-eslint 5b65372
@Hippoom Hippoom added a commit to Hippoom/kibana-guard-plugin that referenced this issue Jun 17, 2016
@Hippoom Hippoom Consolidate escope version to work around incompatbility issue, see b… 85bcbe8
@cchamberlain

@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 yomexzo added a commit to Shopify/js-buy-sdk that referenced this issue Aug 22, 2016
@minasmart @yomexzo minasmart + yomexzo attempt to fix weird eslint build error. 87a41d5
@emflores emflores added a commit to emflores/navigo that referenced this issue Sep 19, 2016
@emflores emflores upgrade eslint to fix babel/babel-eslint#243 952e09c
@emflores emflores referenced this issue in krasimir/navigo Sep 19, 2016
Closed

Upgrade babel-eslint #45

@emflores emflores added a commit to emflores/navigo that referenced this issue Sep 19, 2016
@emflores emflores upgrade eslint to fix babel/babel-eslint#243
babel-eslint -> devDep

revert dep prop deletion
4c5cb03
@emflores emflores referenced this issue in krasimir/navigo Sep 19, 2016
Merged

Upgraded babel-eslint #46

@mikkoh mikkoh pushed a commit to Shopify/js-buy-sdk that referenced this issue Oct 12, 2016
@minasmart minasmart attempt to fix weird eslint build error. 05a5e30
@kenfehling kenfehling added a commit to kenfehling/react-router-apply-middleware that referenced this issue Oct 30, 2016
@kenfehling kenfehling Explicity set escope dependency version to 3.3.0
To fix this issue (when running `npm test`): babel/babel-eslint#243
2db93a1
@kenfehling kenfehling referenced this issue in ryanflorence/react-router-apply-middleware Oct 30, 2016
Closed

Explicity set escope dependency version to 3.3.0 #3

@kenfehling kenfehling added a commit to kenfehling/react-router-apply-middleware that referenced this issue Oct 30, 2016
@kenfehling kenfehling Upgraded babel-eslint version to 7.1.0
To fix this issue (when running `npm test`): babel/babel-eslint#243
ecc54a3
@natoverse natoverse added a commit to atsid/badger that referenced this issue Dec 28, 2016
@natoverse natoverse (#44) - Upgrade babel-eslint
- 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
53786f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment