orktes / atom-react

ReactJS Support for atom (syntax, snippets)
http://orktes.github.io/atom-react/
MIT License
476 stars 78 forks source link

Failed to activate the react package; Cannot read property 'source.js.jsx' of undefined. (Atom 1.24) #269

Closed tinyearth closed 6 years ago

tinyearth commented 6 years ago

Step To Reproduce

  1. Open Atom

Atom: 1.24.0 x64 Electron: 1.6.16 OS: Mac OS X 10.13.3 Thrown From: react package 0.17.0

Stack Trace

Failed to activate the react package

At Cannot read property 'source.js.jsx' of undefined

TypeError: Cannot read property 'source.js.jsx' of undefined
    at AtomReact.autoSetGrammar (/packages/react/lib/atom-react.coffee:134:54)
    at AtomReact.processEditor (/packages/react/lib/atom-react.coffee:322:6)
    at Workspace.observeTextEditors (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:728:15)
    at AtomReact.activate (/packages/react/lib/atom-react.coffee:343:46)
    at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:230:33)
    at measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:206:33)
    at Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:88:25)
    at activationPromise.Promise (/Applications/Atom.app/Contents/Resources/app/src/package.js:200:20)
    at Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:198:38)
    at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:695:42)
    at config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:670:36)
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/config.js:367:24)
    at PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:668:23)
    at PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:647:50)
    at loadStatePromise.loadState.then (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:841:27)

Commands

     -0:05.4.0 core:select-all (input.hidden-input)
     -0:04.6.0 core:backspace (input.hidden-input)
     -0:04.1.0 core:paste (input.hidden-input)
     -0:03.5.0 core:select-all (input.hidden-input)
     -0:02.7.0 core:backspace (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-expressionengine 1.1.4 
atom-html-preview 0.2.5 
atom-material-syntax 1.0.8 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.1.1 
atom-wrap-in-tag 0.6.0 
busy-signal 1.4.3 
city-lights-syntax 1.1.6 
city-lights-ui 1.3.1 
double-tag 1.1.0 
emmet 2.4.3 
intentions 1.1.5 
linter 2.2.0 
linter-eslint 8.4.1 
linter-ui-default 1.6.10 
preview 0.17.0 
react 0.17.0 
svg-preview 0.12.1 
AnthonyNTK commented 6 years ago

Steps to reproduce

  1. Open Atom

Atom: 1.24.0 ia32 Electron: 1.6.16 OS: Windows 10 Thrown From: react package 0.17.0

Stack Trace

Failed to activate the react package

At Cannot read property 'source.js.jsx' of undefined

TypeError: Cannot read property 'source.js.jsx' of undefined
    at AtomReact.autoSetGrammar (/packages/react/lib/atom-react.coffee:134:54)
    at AtomReact.processEditor (/packages/react/lib/atom-react.coffee:322:6)
    at Workspace.observeTextEditors (~/AppData/Local/atom/app-1.24.0/resources/app/src/workspace.js:728:15)
    at AtomReact.activate (/packages/react/lib/atom-react.coffee:343:46)
    at Package.activateNow (~/AppData/Local/atom/app-1.24.0/resources/app/src/package.js:230:33)
    at measure (~/AppData/Local/atom/app-1.24.0/resources/app/src/package.js:206:33)
    at Package.measure (~/AppData/Local/atom/app-1.24.0/resources/app/src/package.js:88:25)
    at activationPromise.Promise (~/AppData/Local/atom/app-1.24.0/resources/app/src/package.js:200:20)
    at Package.activate (~/AppData/Local/atom/app-1.24.0/resources/app/src/package.js:198:38)
    at PackageManager.activatePackage (~/AppData/Local/atom/app-1.24.0/resources/app/src/package-manager.js:695:42)
    at config.transactAsync (~/AppData/Local/atom/app-1.24.0/resources/app/src/package-manager.js:670:36)
    at Config.module.exports.Config.transactAsync (~/AppData/Local/atom/app-1.24.0/resources/app/src/config.js:367:24)
    at PackageManager.activatePackages (~/AppData/Local/atom/app-1.24.0/resources/app/src/package-manager.js:668:23)
    at PackageManager.activate (~/AppData/Local/atom/app-1.24.0/resources/app/src/package-manager.js:647:50)
    at loadStatePromise.loadState.then (~/AppData/Local/atom/app-1.24.0/resources/app/src/atom-environment.js:841:27)

Commands

Non-Core Packages

advanced-open-file 0.16.7 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.1 
react 0.17.0 

``

duien commented 6 years ago

It looks like this was broken by atom/atom#16297 since the refactor didn't add a shim for the grammarsByScopeName. I looks like grammarForScopeName() is a replacement that's available before and after refactor, so I'm going to try to PR that fix.

Dajust commented 6 years ago

Any update on this?

tinyearth commented 6 years ago

@Dajust see above where @duien put in a fix.

Until her edits get merged, you could just uninstall the broken package and install hers in place. Use this to search packages in Atom: git@github.com:duien/atom-react.git

hogyun3709 commented 6 years ago

git@github.com:duien/atom-react.git This won't work as well.

Any updates?

nukeop commented 6 years ago

I just got this as well.

orktes commented 6 years ago

Try latest release v0.18.0