Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined #475

Closed

Description

@mrameezraja

[Enter steps to reproduce below:]

  1. Its happening after the latest update. Error is occurring while i type.

Atom Version: 0.196.0
System: Mac OS X 10.10.3
Thrown From: autocomplete-plus package, v2.17.0

Stack Trace

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

At /Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:214

TypeError: Cannot read property 'toLowerCase' of undefined
  at SymbolProvider.module.exports.SymbolProvider.fuzzyFilter (/Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:214:57)
  at SymbolProvider.module.exports.SymbolProvider.findSuggestionsForWord (/Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:197:42)
  at SymbolProvider.findSuggestionsForWord (/Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:3:1)
  at SymbolProvider.module.exports.SymbolProvider.getSuggestions (/Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:183:6)
  at SymbolProvider.getSuggestions (/Users/developer/.atom/packages/autocomplete-plus/lib/symbol-provider.coffee:3:1)
  at /Users/developer/.atom/packages/autocomplete-plus/lib/autocomplete-manager.coffee:159:45
  at Array.forEach (native)
  at AutocompleteManager.module.exports.AutocompleteManager.getSuggestionsFromProviders (/Users/developer/.atom/packages/autocomplete-plus/lib/autocomplete-manager.coffee:139:15)
  at AutocompleteManager.getSuggestionsFromProviders (/Users/developer/.atom/packages/autocomplete-plus/lib/autocomplete-manager.coffee:1:1)
  at AutocompleteManager.module.exports.AutocompleteManager.findSuggestions (/Users/developer/.atom/packages/autocomplete-plus/lib/autocomplete-manager.coffee:133:6)
  at /Users/developer/.atom/packages/autocomplete-plus/lib/autocomplete-manager.coffee:1:1

Commands

     -1:31.6.0 core:backspace (atom-text-editor.editor.is-focused)
  4x -1:28 core:copy (atom-text-editor.editor.is-focused)
     -1:24.9.0 core:paste (atom-text-editor.editor.is-focused)
     -1:18.6.0 core:save (atom-text-editor.editor.is-focused)
     -1:04.7.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:04.1.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:21.8.0 core:copy (atom-text-editor.editor.is-focused)
     -0:20.8.0 core:paste (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  },
  "autocomplete-plus": {
    "confirmCompletion": "enter"
  }
}

Installed Packages

# User
atom-beautify, v0.27.2
autocomplete-plus, v2.17.0
open-last-project, v0.4.1

# Dev
No dev packages

Activity

  1. mnquintana commented on May 21, 2015

    @mnquintana
    Contributor

    Can you try updating to the latest version (0.200.0) and see if you can reproduce this?

  2. mrameezraja commented on May 21, 2015

    @mrameezraja
    Author

    I have updated atom to version (0.200.0) but the problem still persists. I have to disable auto-complete to work. Error is generating on every keypress. :(

  3. mnquintana commented on May 21, 2015

    @mnquintana
    Contributor

    Can you reproduce this in safe mode (atom --safe)?

  4. benogle commented on May 21, 2015

    @benogle
    Contributor

    Can you paste a file that causes this into a gist or the issue itself? Looks like an empty string is getting into the symbol store. Sorry about this.

  5. self-assigned this
    on May 21, 2015
  6. mrameezraja commented on May 26, 2015

    @mrameezraja
    Author

    Create new file and you will get the error on first keypress.

  7. added a commit that references this issue on May 27, 2015
    26ce3c3
  8. benogle commented on May 27, 2015

    @benogle
    Contributor

    I am unable to reproduce this, but I added a check for this case. Not sure what the root cause is. @mrameezraja if you can provide more information that would be great:

    • Does this happen in safe mode atom --safe?
    • Do you have other files open when this happens?
    • What do you type to make this happen?
  9. mrameezraja commented on May 28, 2015

    @mrameezraja
    Author
    1. This issue does not happen in --safe mode. (autocomplete does not work either.)
    2. Yes there are other files open when this happen but if there is only one file, this happens.
    3. When i type any character, this happens.

    One thing more i am using atom on mac machine.

  10. mrameezraja commented on May 28, 2015

    @mrameezraja
    Author

    Well its working after i upgraded atom to 0.202.0.

  11. dustin-H commented on Jun 19, 2015

    @dustin-H

    Hi, got this Problem on 0.210.0.
    You can reproduce by creating a new .js file and type var i = 9;

    Update: Fixed it by completely uninstall and reinstall atom. Strange

  12. RomFouq commented on Jun 20, 2015

    @RomFouq

    I have the same problem, but this appends only when typing non-alphanumeric characters or backspace (because I have the "Allow backspace to trigger autocomplete" option enabled).
    This comes from the line https://github.com/atom/autocomplete-plus/blob/master/lib/symbol-provider.coffee#L212, it's either prefix[0] or text[0] that's undefined for these characters.
    For example, typing $ triggers this error.

  13. benogle commented on Jun 22, 2015

    @benogle
    Contributor

    @RomFouq what version are you on? Please upgrade to the latest version and try again.

  14. swgillespie commented on Jun 25, 2015

    @swgillespie

    This happens to me on Atom 1.0. What @RomFouq observed also seems to be true for me - the error only occurs after typing non-alphanumeric characters or backspace. I can reproduce this by generating a new Atom package, navigating to the main lib file, and typing any non-alphanumeric character.

    This also only happens when I set my minimum word length to 0. Setting it back to the default makes the issue go away.

  15. RomFouq commented on Jun 27, 2015

    @RomFouq

    I was on v0.210.0 but I upgraded to v1.0.0, did all updates, but the problem is the same...

  16. RomFouq commented on Jun 27, 2015

    @RomFouq

    I agree with @swgillespie: this only happens when minimum word length is set to 0, even with 1, this never happens.

  17. ssfrr commented on Jul 6, 2015

    @ssfrr

    I'm seeing this issue as well. It seems to be happening while I'm editing my keymap file for some reason.

  18. benogle commented on Jul 7, 2015

    @benogle
    Contributor

    Anyone who gets this, can you please paste in the entire error report? There are several uses of toLowerCase in the code, and i'm not sure which one is having the problem.

  19. added a commit that references this issue on Jul 7, 2015
    fa4710b
  20. swgillespie commented on Jul 7, 2015

    @swgillespie

    @benogle:

    [Enter steps to reproduce below:]

    1. Set Minimum Word Length to 0
    2. Go to a buffer with autocompletion enabled and type a non-numeric character

    Atom Version: 1.0.0
    System: Mac OS X 10.10.1
    Thrown From: autocomplete-plus package, v2.17.4

    Stack Trace

    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

    At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/symbol-provider.js:345
    
    TypeError: Cannot read property 'toLowerCase' of undefined
      at SymbolProvider.module.exports.SymbolProvider.fuzzyFilter (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/symbol-provider.js:345:32)
      at SymbolProvider.module.exports.SymbolProvider.getSuggestions (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/symbol-provider.js:322:53)
      at SymbolProvider.getSuggestions (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/symbol-provider.js:3:61)
      at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:255:56
      at Array.forEach (native)
      at AutocompleteManager.module.exports.AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:234:17)
      at AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:3:61)
      at AutocompleteManager.module.exports.AutocompleteManager.findSuggestions (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:221:19)
      at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:3:61
    
    

    Commands

    Config

    {
      "core": {
        "themes": [
          "one-dark-ui",
          "monokai"
        ],
        "projectHome": "/Users/sean/Documents/workspace",
        "disabledPackages": [
          "metrics",
          "autocomplete-clang",
          "autocomplete-ruby"
        ]
      },
      "autocomplete-plus": {
        "minimumWordLength": 0
      }
    }

    Installed Packages

    # User
    autocomplete-paths, v1.0.2
    color-picker, v2.0.7
    jshint, v1.3.8
    language-rust, v0.4.3
    linter, v1.0.5
    linter-clang, v2.26.0
    linter-ruby, v0.1.6
    linter-rust, v0.1.0
    minimap, v4.10.0
    monokai, v0.14.0
    pigments, v0.8.2
    racer, v0.15.2
    react, v0.12.3
    
    # Dev
    No dev packages
  21. benogle commented on Jul 7, 2015

    @benogle
    Contributor

    ❤️ ❤️ for the report

  22. added a commit that references this issue on Jul 7, 2015
    4b9027a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions