Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

TypeError: Cannot read property 'toLowerCase' of undefined #94

Closed
aaroncarsonart opened this issue May 24, 2016 · 4 comments
Closed

TypeError: Cannot read property 'toLowerCase' of undefined #94

aaroncarsonart opened this issue May 24, 2016 · 4 comments
Assignees
Labels

Comments

@aaroncarsonart
Copy link

When I create a new file Test.java and save it with the following content:

public class Test
{

}

I get this stack trace error popup:

TypeError: Cannot read property 'toLowerCase' of undefined
TypeError: Cannot read property 'toLowerCase' of undefined
    at new Directory (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/directory.js:47:39)
    at Object.lint (/Users/acarson/.atom/packages/linter-javac/lib/init.coffee:121:47)
    at promises.push.Promise.then._this.emitter.emit.linter (/Users/acarson/.atom/packages/linter/lib/linter-registry.js:63:26)
    at /Users/acarson/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (/Users/acarson/.atom/packages/linter/lib/linter-registry.js:60:18)
    at /Users/acarson/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/acarson/.atom/packages/linter/lib/editor-linter.js:30:20
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1113:27)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1083:19)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:660:26)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:718:18)
    at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:701:19)
    at Workspace.module.exports.Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:684:35)
    at atom-workspace.commandRegistry.add.core:save (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:214:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

screen shot 2016-05-24 at 11 33 36 am

@florianb
Copy link
Contributor

@aaroncarsonart: Thanks a lot for reporting, i will take a look why this happens.

@florianb florianb added the bug label May 25, 2016
@florianb
Copy link
Contributor

florianb commented May 25, 2016

Okay, it seems this happens if the Java-file is placed underneath a symbolic link. I am going to investigate further, it might be that this happens due to an issue in the atom-pathwatcher-library.

This is error seems to pop up since we're not dedicated handling symlinks, as the pathwatcher-API efforts. I am working on a patch.

@florianb florianb self-assigned this May 25, 2016
florianb pushed a commit to florianb/linter-javac that referenced this issue May 25, 2016
florianb pushed a commit to florianb/linter-javac that referenced this issue May 25, 2016
florianb pushed a commit to florianb/linter-javac that referenced this issue May 25, 2016
@aaroncarsonart
Copy link
Author

aaroncarsonart commented May 26, 2016

Yeah, that makes sense. I can verify the problem file was in a symbolic link directory. It linked to a location residing on my Dropbox, not sure if that would matter though. (that much is clear from my screenshot)

@florianb
Copy link
Contributor

Thanks for verification - i guess i already have some sort of solution and currently try to figure out how hook into the promised callback chain of hell. I guess you can expect the patch until tomorrow.

florianb pushed a commit to florianb/linter-javac that referenced this issue May 26, 2016
- Add specs for issue AtomLinter#94
- Add test to verify working symlinks as higher directories
- Fix Directory-call, add fallback path for getProjectRootDir
- Fix links, updated Latest Changes
- Add subdirectory to fixtures
- Refactor base-specs

> getProjectDir's implementation is faulty since it does not proper
handle the appearance of symlinks (see :251).
florianb pushed a commit to florianb/linter-javac that referenced this issue May 26, 2016
- Add specs for issue AtomLinter#94
- Add test to verify working symlinks as higher directories
- Fix Directory-call, add fallback path for getProjectRootDir
- Fix links, updated Latest Changes
- Add subdirectory to fixtures
- Refactor base-specs

> getProjectDir's implementation is faulty since it does not proper
handle the appearance of symlinks (see :251).
florianb pushed a commit that referenced this issue May 26, 2016
- Add specs
- Add test to verify working symlinks as higher directories
- Fix Directory-call, add fallback path for getProjectRootDir
- Fix links, updated Latest Changes
- Add subdirectory to fixtures
- Refactor base-specs
- Fix issue reference in iss36-spec

> getProjectDir's implementation is faulty since it does not proper
handle the appearance of symlinks (see :251).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants