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

DEBUG not working with webpack resolver? #681

Closed
benmvp opened this issue Nov 29, 2016 · 5 comments · Fixed by renovatebot/renovate#217
Closed

DEBUG not working with webpack resolver? #681

benmvp opened this issue Nov 29, 2016 · 5 comments · Fixed by renovatebot/renovate#217

Comments

@benmvp
Copy link

benmvp commented Nov 29, 2016

I'm having trouble integrating eslint-import-resolver-webpack. I'm assuming it's something with the way my webpack.config.js is set up because everything is complaining. I tried doing:

DEBUG=eslint-plugin-import:* ./node_modules/.bin/eslint src/atoms/textInput/docs/Page.js

But it doesn't provide any info:

/Users/ben.ilegbodu/eventbrite/eventbrite_design_system/src/atoms/textInput/docs/Page.js
   1:19  error  Unable to resolve path to module 'react'                                              import/no-unresolved
   3:27  error  Unable to resolve path to module 'foundation/containers/documentation/Documentation'  import/no-unresolved
   4:25  error  Unable to resolve path to module '_documentation/CodeExample'                         import/no-unresolved
   6:24  error  Unable to resolve path to module './README'                                           import/no-unresolved
   8:27  error  Unable to resolve path to module '!raw!../TextInput'                                  import/no-unresolved
  10:40  error  Unable to resolve path to module '!raw!./TextInputSimpleExample'                      import/no-unresolved
  11:36  error  Unable to resolve path to module './TextInputSimpleExample'                           import/no-unresolved
  13:39  error  Unable to resolve path to module '!raw!./TextInputErrorExample'                       import/no-unresolved
  14:35  error  Unable to resolve path to module './TextInputErrorExample'                            import/no-unresolved
  16:42  error  Unable to resolve path to module '!raw!./TextInputDisabledExample'                    import/no-unresolved
  17:38  error  Unable to resolve path to module './TextInputDisabledExample'                         import/no-unresolved
  19:38  error  Unable to resolve path to module '!raw!./TextInputTypeExample'                        import/no-unresolved
  20:34  error  Unable to resolve path to module './TextInputTypeExample'                             import/no-unresolved
  22:48  error  Unable to resolve path to module '!raw!./TextInputCurrencySymbolExample'              import/no-unresolved
  23:44  error  Unable to resolve path to module './TextInputCurrencySymbolExample'                   import/no-unresolved
  25:38  error  Unable to resolve path to module '!raw!./TextInputIconExample'                        import/no-unresolved
  26:34  error  Unable to resolve path to module './TextInputIconExample'                             import/no-unresolved
  28:46  error  Unable to resolve path to module '!raw!./TextInputEventHandlerExample'                import/no-unresolved
  29:42  error  Unable to resolve path to module './TextInputEventHandlerExample'                     import/no-unresolved
  31:41  error  Unable to resolve path to module '!raw!./TextInputMaxCharExample'                     import/no-unresolved
  32:37  error  Unable to resolve path to module './TextInputMaxCharExample'                          import/no-unresolved
  34:28  error  Unable to resolve path to module '../constants'                                       import/no-unresolved

Any ideas? I figure if I could get the debug information I could figure out what was going on.

Miscellaneous info:

  • eslint-import-resolver-webpack: ^0.7.0
  • webpack: ^1.13.0
  • eslint-plugin-import: ^2.2.0

.eslint.json:

{
    "extends": [
        "eventbrite-react",
        "plugin:import/errors",
        "plugin:import/warnings"
    ],
    "plugins": [
        "import"
    ],
    "settings":{
        "import/resolver": "webpack"
    }
}

If I use the default node resolver instead, I do get debug information and it only complains about the special loaders. Importing react, for instance is no longer an error.

My webpack.config.js is a sibling of package.json FWIW. Also webpack is working normally 😄 .

Thanks for any help!

@benmvp
Copy link
Author

benmvp commented Nov 29, 2016

Okay, did some additional sleuthing and I think I found the issue. I believe the issue is related to this commit: f507ff3#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

It introduces use of the has micro library. has is included in the root package.json, but not the eslint-import-resolver-webpack package.json.

I'm still running on NPM 2, so has won't be in a parent node_modules folder from the import-resolver-webpack folder. The resolver was blowing up silently, which is why everything was failing. I manually installed has in the folder and everything started working as expected!

Seems like the fix would be to add has to the package.json for import-resolver-webpack?

@ljharb
Copy link
Member

ljharb commented Nov 29, 2016

Whoops, good call, I didn't realize there was another package.json in the repo - typically repos either only contain one project, or contain all projects not-at-the-top-level.

Definitely that's the fix.

ljharb added a commit to ljharb/eslint-plugin-import that referenced this issue Nov 29, 2016
@ljharb
Copy link
Member

ljharb commented Nov 29, 2016

Filed #683 to correct this.

@benmvp
Copy link
Author

benmvp commented Nov 29, 2016

Let me know when a new package is published! Thanks again!

benmosher pushed a commit that referenced this issue Dec 9, 2016
@benmosher
Copy link
Member

Published. 😅 Thanks, both of y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants