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

Generic build error when updating from 10.2.4-canary.2 to any version above #26574

Closed
huggge opened this issue Jun 24, 2021 · 4 comments
Closed
Assignees
Milestone

Comments

@huggge
Copy link

huggge commented Jun 24, 2021

What version of Next.js are you using?

10.2.4-canary.3

What version of Node.js are you using?

14.16.1

What browser are you using?

Chrome

What operating system are you using?

MacOs & Windows

How are you deploying your application?

next start

Describe the Bug

When using 10.2.4-canary.2 or earlier versions building works fine, but when upgrading to 10.2.4-canary.3 or any version above I get this very anonymously error. It do however work to start in dev

`

yarn build                        
yarn run v1.22.10
$ next build
info  - Loaded env from /Users/user/Desktop/dashboard/.env.local
info  - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
NODE ENV: production
info  - Checking validity of types  
To use ESLint, additional required package(s) must be installed.

Please install eslint-config-next by running:

        yarn add --dev eslint-config-next

If you do not want to run ESLint during builds, run next build --no-lint or remove the .eslintrc.json file from your package root.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

`

This is happening in two separate projects and I have tried building them on both macOs and Windows, but dont even know where to start debugging with this very generic build error.

Does anyone have a clue of what could be causing this? I've narrowed it down to 10.2.4-canary.3

Lord please..!

Expected Behavior

Should be able to build project with never version than 10.2.4-canary.2

To Reproduce

Update to 10.2.4-canary.3 and try to build

@huggge huggge added the bug Issue was opened via the bug report template. label Jun 24, 2021
@advaiyalad
Copy link

advaiyalad commented Jun 24, 2021

@huggge Either run yarn add -D eslint-config-next (to add next.js eslint config), or run yarn build --no-lint to not run linting on builds. Or, lastly, remove the eslint config from your package root.

If you install eslint-config-next, you also want to add { "extends": ["next", "next/core-web-vitals"] } to your .eslintrc.json file.

@housseindjirdeh
Copy link
Collaborator

@PythonCreator27 is correct, you'll have to do one of the following:

Note: I have a PR open that improves the developer experience and does not require eslint-config-next to be installed. Once that lands, you'll never see this error message again - but in the meantime you'll have to do one of the above :)

@huggge
Copy link
Author

huggge commented Jun 27, 2021

Thanks for the help guys!

kodiakhq bot pushed a commit that referenced this issue Aug 4, 2021
…e first time (#26584)

This PR introduces an improved developer experience when `next lint` is run for the first time.

### Current behavior

`eslint-config-next` is a required package that must be installed before proceeding with `next lint` or `next build`:

![image](https://user-images.githubusercontent.com/12476932/123468791-43088100-d5c0-11eb-9ad0-5beb80b6c968.png)

Although this has helped many developers start using the new ESLint config, this has also resulted in a few issues:

- Users are required to install the full config (`eslint-config-next`) even if they do not use it or use the Next.js plugin directly (`eslint-plugin-next`).
  - #26348

- There's some confusion  on why `eslint-config-next` needs to be installed or how it should be used instead of `eslint-plugin-next`.
  - #26574
  - #26475
  - #26438

### New behavior

Instead of enforcing `eslint-config-next` as a required package, this PR prompts the user by asking what config they would like to start. This happens when `next lint` is run for the first time **and** if no ESLint configuration is detected in the application.

<img src="https://user-images.githubusercontent.com/12476932/124331177-e1668a80-db5c-11eb-8915-38d3dc20f5d4.gif" width="800" />

- The CLI will take care of installing `eslint` or `eslint-config-next` if either is not already installed
- Users now have the option to choose between a strict configuration (`next/core-web-vitals`) or just the base configuration (`next`)
- For users that decide to create their own ESLint configuration, or already have an existing one, **installing `eslint-config-next` will not be a requirement for `next lint` or `next build` to run**. A warning message will just show if the Next.js ESLint plugin is not detected in an ESLint config. 

  <img width="682" alt="Screen Shot 2021-06-25 at 3 02 12 PM" src="https://user-images.githubusercontent.com/12476932/123473329-6cc4a680-d5c6-11eb-9a57-d5c0b89a2732.png">

---

In addition, this PR also:

- Fixes #26348
- Updates documentation to make it more clear what approach to take for new and existing ESLint configurations
flybayer pushed a commit to blitz-js/next.js that referenced this issue Aug 19, 2021
…e first time (vercel#26584)

This PR introduces an improved developer experience when `next lint` is run for the first time.

### Current behavior

`eslint-config-next` is a required package that must be installed before proceeding with `next lint` or `next build`:

![image](https://user-images.githubusercontent.com/12476932/123468791-43088100-d5c0-11eb-9ad0-5beb80b6c968.png)

Although this has helped many developers start using the new ESLint config, this has also resulted in a few issues:

- Users are required to install the full config (`eslint-config-next`) even if they do not use it or use the Next.js plugin directly (`eslint-plugin-next`).
  - vercel#26348

- There's some confusion  on why `eslint-config-next` needs to be installed or how it should be used instead of `eslint-plugin-next`.
  - vercel#26574
  - vercel#26475
  - vercel#26438

### New behavior

Instead of enforcing `eslint-config-next` as a required package, this PR prompts the user by asking what config they would like to start. This happens when `next lint` is run for the first time **and** if no ESLint configuration is detected in the application.

<img src="https://user-images.githubusercontent.com/12476932/124331177-e1668a80-db5c-11eb-8915-38d3dc20f5d4.gif" width="800" />

- The CLI will take care of installing `eslint` or `eslint-config-next` if either is not already installed
- Users now have the option to choose between a strict configuration (`next/core-web-vitals`) or just the base configuration (`next`)
- For users that decide to create their own ESLint configuration, or already have an existing one, **installing `eslint-config-next` will not be a requirement for `next lint` or `next build` to run**. A warning message will just show if the Next.js ESLint plugin is not detected in an ESLint config. 

  <img width="682" alt="Screen Shot 2021-06-25 at 3 02 12 PM" src="https://user-images.githubusercontent.com/12476932/123473329-6cc4a680-d5c6-11eb-9a57-d5c0b89a2732.png">

---

In addition, this PR also:

- Fixes vercel#26348
- Updates documentation to make it more clear what approach to take for new and existing ESLint configurations
@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 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants