New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
@dan-gamble

dan-gamble commented Feb 1, 2016

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

This comment has been minimized.

Show comment
Hide comment
@Havunen

Havunen Feb 1, 2016

same issue.

Havunen commented Feb 1, 2016

same issue.

@chromakode

This comment has been minimized.

Show comment
Hide comment
@chromakode

chromakode Feb 1, 2016

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

chromakode commented Feb 1, 2016

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

This comment has been minimized.

Show comment
Hide comment
@riffraff

riffraff Feb 1, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@dan-gamble

dan-gamble Feb 1, 2016

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

dan-gamble commented Feb 1, 2016

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

@Havunen

This comment has been minimized.

Show comment
Hide comment
@Havunen

Havunen Feb 1, 2016

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

Havunen commented Feb 1, 2016

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

@dan-gamble

This comment has been minimized.

Show comment
Hide comment
@dan-gamble

dan-gamble Feb 1, 2016

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

dan-gamble commented Feb 1, 2016

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

@Havunen

This comment has been minimized.

Show comment
Hide comment
@Havunen

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

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

This comment has been minimized.

Show comment
Hide comment
@chromakode

chromakode Feb 1, 2016

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

chromakode commented Feb 1, 2016

@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

This comment has been minimized.

Show comment
Hide comment

bluejamesbond commented Feb 1, 2016

+1

@stevesims

This comment has been minimized.

Show comment
Hide comment
@stevesims

stevesims commented Feb 1, 2016

+1

@indeyets

This comment has been minimized.

Show comment
Hide comment
@indeyets

indeyets commented Feb 1, 2016

Upstream issue: estools/escope#99

@mattdell

This comment has been minimized.

Show comment
Hide comment
@mattdell

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

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

This comment has been minimized.

Show comment
Hide comment
@felipenehmi

felipenehmi commented Feb 1, 2016

+1

@brenopolanski

This comment has been minimized.

Show comment
Hide comment

brenopolanski commented Feb 1, 2016

+1

@rafaferreira

This comment has been minimized.

Show comment
Hide comment

rafaferreira commented Feb 1, 2016

+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

Fixed linting issue
This is an issue with escope which is a dependency for
babel-eslint. See babel/babel-eslint#243
for more info
@jwilander

This comment has been minimized.

Show comment
Hide comment
@jwilander

jwilander commented Feb 1, 2016

+1

instructure-gerrit pushed a commit to instructure/instructure-ui that referenced this issue Feb 1, 2016

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>

@jkrems jkrems referenced this issue Feb 1, 2016

Merged

Run `eslint --fix` #9

lprajus2007 added a commit to lprajus2007/babel-eslint that referenced this issue Feb 1, 2016

jcreamer898 added a commit to lonelyplanet/rizzo-next that referenced this issue Feb 1, 2016

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

This comment has been minimized.

Show comment
Hide comment
@lprajus2007

lprajus2007 Feb 1, 2016

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

lprajus2007 commented Feb 1, 2016

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

This comment has been minimized.

Show comment
Hide comment
@developit

developit Feb 1, 2016

@lprajus2007 tip: npm install lprajus2007/babel-eslint

developit commented Feb 1, 2016

@lprajus2007 tip: npm install lprajus2007/babel-eslint

benvinegar added a commit to getsentry/sentry that referenced this issue Feb 1, 2016

@jamesplease

This comment has been minimized.

Show comment
Hide comment
@jamesplease

jamesplease Feb 1, 2016

Member

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

Member

jamesplease commented Feb 1, 2016

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

@jtheoof

This comment has been minimized.

Show comment
Hide comment
@jtheoof

jtheoof Feb 1, 2016

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

jtheoof commented Feb 1, 2016

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

@pbeets

This comment has been minimized.

Show comment
Hide comment
@pbeets

pbeets Feb 1, 2016

@lprajus2007 works for me, thanks.

pbeets commented Feb 1, 2016

@lprajus2007 works for me, thanks.

@hzoo

This comment has been minimized.

Show comment
Hide comment
@hzoo

hzoo Feb 1, 2016

Member

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

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?

@developit

This comment has been minimized.

Show comment
Hide comment
@developit

developit Feb 1, 2016

@hzoo yes, this is broken for both

developit commented Feb 1, 2016

@hzoo yes, this is broken for both

@hzoo hzoo closed this in d8ac8f9 Feb 1, 2016

@jamesplease

This comment has been minimized.

Show comment
Hide comment
@jamesplease

jamesplease Feb 1, 2016

Member

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

Yup. And thanks for the quick fix!

Member

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

@frozenfung

This comment has been minimized.

Show comment
Hide comment
@frozenfung

frozenfung Mar 14, 2016

4.1.7 works for me. Thanks! 👍

frozenfung commented Mar 14, 2016

4.1.7 works for me. Thanks! 👍

@radu-arimatrix

This comment has been minimized.

Show comment
Hide comment
@radu-arimatrix

radu-arimatrix Mar 15, 2016

├─┬ 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?

radu-arimatrix commented Mar 15, 2016

├─┬ 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

This comment has been minimized.

Show comment
Hide comment
@balaurzor

balaurzor Mar 15, 2016

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

balaurzor commented Mar 15, 2016

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

@radu-arimatrix

This comment has been minimized.

Show comment
Hide comment
@radu-arimatrix

radu-arimatrix Mar 15, 2016

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)

radu-arimatrix commented Mar 15, 2016

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

This comment has been minimized.

Show comment
Hide comment
@Arcanemagus

Arcanemagus Mar 15, 2016

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

Arcanemagus commented Mar 15, 2016

@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

This comment has been minimized.

Show comment
Hide comment
@radu-arimatrix

radu-arimatrix Mar 16, 2016

├── 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?

radu-arimatrix commented Mar 16, 2016

├── 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 added 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

Bump babel-eslint dev dependency
Conservative version bump to fix
babel/babel-eslint#243 which was breaking the
build.

@gzurbach gzurbach referenced this issue May 25, 2016

Closed

Fix the build #101

tmeasday added a commit to meteor/meteor that referenced this issue May 25, 2016

andrew-codes added 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

This comment has been minimized.

Show comment
Hide comment
@cchamberlain

cchamberlain Jul 9, 2016

@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

cchamberlain commented Jul 9, 2016

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

upgrade eslint to fix babel/babel-eslint#243
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

Explicity set escope dependency version to 3.3.0
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

Upgraded babel-eslint version to 7.1.0
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

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

Pr0duktiv pushed a commit to Pr0duktiv/numenta-apps that referenced this issue May 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment