2

I've been experimenting with M-x compile recently (I'm using it to start my node.js-project which will output a stack-trace if there is an error.

I get traces like this:

Error: Configuration property "loggers" is not defined
    at Config.get (/home/myuser/path/to/project/node_modules/config/lib/config.js:179:11)
    at Object.<anonymous> (/home/myuser/path/to/project/lib/setup-logging.js:14:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/myuser/path/to/project/index.js:6:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

Each of the paths there is actually nicely clickable, however when I do click it (or navigate to it and press RET), emacs isn't smart enough to open the right file. Instead, I get a helm-popup saying Find this error in (default setup-logging.js:14): /home/myuser/path/to/project/directory/of/the/currently/open/file where I then have to navigate to the file myself.

I've looked through the docs but I couldn't find anything relating to this issue, can you guys help me out here?

PS: I'm actually using projectile-compile-project rather than compile directly, but I get the same results with plain compile.

1 Answer 1

2

After some tinkering, I was able to trace the problem to emacs wrongly recognizing the column in the trace output as the line number. All I had to do was add a new regexp to compilation-error-regexp-alist-alist like described in this nice post (note that I had to restart emacs for the changes to take effect).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.