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

yarn lint not working on brand new app #29961

Closed
vixalien opened this issue Oct 16, 2021 · 7 comments
Closed

yarn lint not working on brand new app #29961

vixalien opened this issue Oct 16, 2021 · 7 comments
Labels
bug Issue was opened via the bug report template.

Comments

@vixalien
Copy link

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

16.6.1

What browser are you using?

Edge 94

What operating system are you using?

Windows 11 (Insider build: 22000.258)

How are you deploying your application?

next start

Describe the Bug

When I create a brand new app using yarn create next-app, and try to run yarn lint, an error is thrown:

image

I wanted to try out linting cause apparently Im a bad developer for not doing so and I don't know what I'm doing wrong.

Expected Behavior

I would have expected it to lint my app

To Reproduce

  1. Create a brand new app using yarn create next-app
  2. Run next lint in the app directory
@vixalien vixalien added the bug Issue was opened via the bug report template. label Oct 16, 2021
@chongruei
Copy link

chongruei commented Oct 16, 2021

I've just downgrade Eslint from 8.0.1 to 7.32.0 then it's work.

@vixalien
Copy link
Author

vixalien commented Oct 16, 2021

I've just downgrade Eslint from 8.0.1 to 7.32.0 then it's work.

I will try that when I get access to the terminal but I think that this is a bug somehow

@wjd3
Copy link

wjd3 commented Oct 16, 2021

This is definitely related to eslint version 8.0.1. I started getting this error right after upgrading major versions.

@gaston-flores
Copy link

I think this is related to a change in eslint's package.json. They added this field:

  "exports": {
    "./package.json": "./package.json",
    ".": "./lib/api.js",
    "./use-at-your-own-risk": "./lib/unsupported-api.js"
  },

Which causes the require in hasNecessaryDependencies to throw this error:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/api.js' is not defined by "exports" in C:\Users\user\Repos\eslint-bug-test\node_modules\eslint\package.json

Removing the exports field manually from eslint's package.json also fixes this issue.

@stefanprobst
Copy link
Contributor

see #29770 (comment)

@housseindjirdeh
Copy link
Collaborator

Closing as this is a duplicate. Like others mentioned, you'll need to downgrade to v7 for the meantime.

There's an open PR to add support for v8 (#29865). Once all sub-dependencies used in Next.js' ESLint config and plugin is supported, it'll be merged!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

7 participants