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

Uncaught TypeError: undefined is not a function #7

Closed
batjko opened this issue Jul 28, 2014 · 9 comments
Closed

Uncaught TypeError: undefined is not a function #7

batjko opened this issue Jul 28, 2014 · 9 comments
Labels

Comments

@batjko
Copy link

batjko commented Jul 28, 2014

Ok, so I just made Linter work on Windows, using the fix provided by @Glek on issue #112.
And it works great for jshint for example.

But now I am opening a java file and immediately get this error in the Dev Console:
image

Note, all linters seem to be activated ok, but when javac tries to get to work on the current file it gives me this TypeError.

The path to javac is definitely confirmed:
image

@batjko
Copy link
Author

batjko commented Jul 28, 2014

So, thinking it might be that I used a 64bit JDK and shouldn't have, I changed it to my 32bit JDK instead, now I get fewer errors, but still the same message:
image

@batjko
Copy link
Author

batjko commented Jul 28, 2014

This is what I get with Linter Debug turned on:
image

So that tells me I should only add the path, but not the executable for javac!
Fine, changed that.

But I'm still getting the error:
image

This is what my linter.coffee has at line 92:

     lintFile: (filePath, callback) ->
       # build the command with arguments to lint the file
       {command, args} = @getCmdAndArgs(filePath)

And this at the other location in the error stack, line 118:

    process = new Process({command, args, options, stdout, stderr})

Not sure what else to do. Any ideas?

@florianb
Copy link

Hi @batjko, i guess this behaviour is issued by the wrong "slash" between your java-path and the javac-command. Unfortunately this behaviour is part of the main-module. But good news: a fix (steelbrain/linter@936d7a5) is on the way and will help you (hopefully) after the next main-patch.

@batjko
Copy link
Author

batjko commented Jul 29, 2014

Thanks, @florianb. Looking forward to that then.
Great package so far!

@ghost
Copy link

ghost commented Jul 29, 2014

@batjko Could give a fuller copy of your linter.coffee file for analysis? I just downloaded the Javac Linter and it works fine for me, so I suspect there's an issue with the modifications you made to your linter.coffee file.

@batjko
Copy link
Author

batjko commented Jul 29, 2014

I'm not sure it makes sense to embed the whole file in here and it won't allow me to attach it.
Any specific sections you're interested in? I have followed your instructions to the letter with the modifications, which is presumably why the other linters have started working.

Here is that first section you said to change:
image

And the second:
image

Edit: Do I need to replace the forward slash in the screenshot above with a double backslash (i.e. Windows style)?

@ghost
Copy link

ghost commented Jul 29, 2014

I see the problem. You need to leave the else in there, so the code looks like:

if @isNodeExecutable
    Process = BufferedProcess
else
    Process = BufferedProcess

Alternatively, simply replace the entire if-else block with:

Process = BufferedProcess

The problem is that right now, Process only exists if the linter is a node executable (as defined by @isNodeExecutable).

@batjko
Copy link
Author

batjko commented Jul 29, 2014

Ah! That makes so much sense that I don't even remember anymore why I commented that part out.

I get linting output in the console now! Except it only happens on the first error it finds.
With that first linter warning I also get the detach message below, and then nothing happens anymore.
image

Also, there's no visual representation of this linting action in the editor, as with the other linters (e.g. jshint), but I don't know if that's another symptom of the above or a restriction of how javac works?

@ghost
Copy link

ghost commented Jul 29, 2014

The lack of error highlighting is due to a bad regex pattern. See the pull request #8 for a fix.

florianb pushed a commit that referenced this issue Feb 19, 2016
add additional descriptions to config settings, fix #65
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

4 participants