Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug a custom resolver? All logs and errors are swallowed #819

Closed
callumlocke opened this issue May 4, 2017 · 2 comments
Closed

Comments

@callumlocke
Copy link

I'm trying to write a custom resolver, and when I run eslint ., it seems to hide any console.log coming from my resolver, and it quietly swallows any errors thrown by it. So all I can see is "Unable to resolve path to module..." errors.

How am I supposed to debug my resolver?

@RobinClowers
Copy link

@callumlocke Check out this PR: #599 it will print stack traces for actual errors so you can track them down.

@Izhaki
Copy link

Izhaki commented May 20, 2021

The plugin itself uses debug:

const log = require('debug')('eslint-plugin-import:resolver:node');

exports.interfaceVersion = 2;
exports.resolve = function (source, file, config) { 
  log('Resolving:', source, 'from:', file);
  //...
}

https://github.com/benmosher/eslint-plugin-import/blob/master/resolvers/node/index.js

But for me console.log works just fine.

I've landed on this issue because I couldn't see console.log, but then I realised this was because my eslint config was incorrect (I've copied/pasted the settings block into the existing settings block).

I think this issue can be closed.

@ljharb ljharb closed this as completed May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants