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.

Cannot read property 'replace' of undefined in certain filetypes #956

@tylerFowler

Description

@tylerFowler

Edit by @rsese to add repro steps

  1. Start Atom in safe mode atom --safe
  2. Add _ to Settings > Editor > Non Word Characters
  3. Create a new file
  4. Start typing in the new file

macOS 10.12.6 and Atom 1.25.


I find that in certain file types I get this exception thrown (Atom Beta). So far I've found it reliably does it in git commit message types (invoked by git-plus) and in Go files, but have not seen it with the same version in JS or Java files. It tends to keep throwing this error over and over as I type.

Worth noting this error was definitely not present until the latest Beta update, which included autocomplete-plus version 2.40.2

Atom: 1.25.0-beta0 x64
Electron: 1.7.11
OS: Mac OS X 10.13.3
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Applications/Atom Beta.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:527

TypeError: Cannot read property 'replace' of undefined
    at AutocompleteManager.getWordCharacterRegex (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:527:72)
    at AutocompleteManager.getPrefix (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:507:43)
    at AutocompleteManager.findSuggestions (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:260:31)

Commands

  2x -0:09.1.0 core:move-down (input.hidden-input)
     -0:07.3.0 editor:delete-to-beginning-of-word (input.hidden-input)
     -0:06.6.0 core:backspace (input.hidden-input)
     -0:05.8.0 editor:delete-to-beginning-of-word (input.hidden-input)
     -0:04.3.0 core:move-up (input.hidden-input)

Non-Core Packages

Was able to reproduce in safe mode

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions