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

Resolve error: require(...).promisify is not a function (import/no-unresolved) #1454

Closed
sebj54 opened this issue Jun 3, 2018 · 7 comments
Closed

Comments

@sebj54
Copy link

sebj54 commented Jun 3, 2018

Version

3.0.0-beta.15

Reproduction link

https://codesandbox.io/s/vue

Steps to reproduce

Create a sample Vue project.
Open project in VS Code with eslint plugin.
Open "Home.vue" file, wait for errors to come.

What is expected?

No error in "Problems" tab.

What is actually happening?

Several eslint import problems like these:

Resolve error: require(...).promisify is not a function (import/no-unresolved)
Resolve error: require(...).promisify is not a function (import/no-extraneous-dependencies)
Resolve error: require(...).promisify is not a function (import/no-duplicates)
Resolve error: require(...).promisify is not a function (import/extensions)
Resolve error: require(...).promisify is not a function (import/no-named-as-default)
Resolve error: require(...).promisify is not a function (import/no-named-as-default-member)
Unable to resolve path to module '@/components/HelloWorld.vue'. (import/no-unresolved)

Please tell me if you need more information (especially versions but nearly everything is up to date), I'll be happy to help!

@mehwww
Copy link

mehwww commented Jun 4, 2018

It seems cuz node ship with electorn which vscode using version is 7.9.0, and this line use the new promisify api ship with node 8.x and break the eslint, use a vendor lib do the promisify work can resolve this issue.

A workaround is specify import/resolver in .eslintrc.js like this
2018-06-04 6 27 50

@sebj54
Copy link
Author

sebj54 commented Jun 4, 2018

Thanks!
Your workaround is working for me, but it seems like unresolved paths are not reported by eslint anymore. It is not so important because webpack throws errors if paths are wrong.

@yyx990803
Copy link
Member

FYI, I can't reproduce the problem with a project created by the latest CLI + VSCode + ESLint plugin.

It's weird because your editor's ESLint plugin should not attempt to lint library code, so that's definitely a configuration problem for your plugin.

@thomasmichaelwallace
Copy link

I think you were premature closing this issue. I've hit it, and can trace it directly to the line/cause @mehwww states:
#1473

@sebj54
Copy link
Author

sebj54 commented Jun 5, 2018

ESLint plugin should not attempt to lint library code

It's actually linting the sample project's code. I don't understand your point of view. It's clear here that this project and the plugin are incompatible. I'm just trying to get a fix (it can also be a extra configuration of the plugin) and get that fix documented if it needs to be.

Thanks @thomasmichaelwallace for your extra information! I hope it will help to find a solution.

@chanlito
Copy link

chanlito commented Jun 7, 2018

Suddenly my project is showing this error too. Dunno how to fix it atm.

EDIT: followed this #1454 (comment) and the errors are not showing anymore.

@thomasmichaelwallace
Copy link

Just so you know, this got fixed under #1473 .

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

No branches or pull requests

5 participants