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

eslint error for 1.24 - unable to install/build #856

Closed
meepmeep opened this issue Nov 22, 2021 · 15 comments
Closed

eslint error for 1.24 - unable to install/build #856

meepmeep opened this issue Nov 22, 2021 · 15 comments

Comments

@meepmeep
Copy link

Hi
I tried to update to 1.24.0 and got a lot of errors from eslint ..
To find a solution, I tried to remove the umami folder, cleered the npm cache and start from the begining, but I still got a blocking error :

Firefly:~/umami$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: umami@1.24.0
npm ERR! Found: eslint@8.1.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^8.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^7.23.0" from eslint-config-next@12.0.1
npm ERR! node_modules/eslint-config-next
npm ERR!   dev eslint-config-next@"^12.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/lufi/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lufi/.npm/_logs/2021-11-22T08_24_11_235Z-debug.log

I'm not very familiar with npm.

Nodejs : v14.18.1
Debian 11.1

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

I need to fix up the package dependencies, but for now you can do this. In package.json replace eslint ^8.1.0 with ^7.32.0 and stylelint ^14.0.1 with ^13.13.0. Then reinstall.

@meepmeep
Copy link
Author

npm install goes through with theses modification.

However (because I delete/re-clone) the umami folder, npm run build is now broken :

Firefly:~/umami$ npm run build

> umami@1.24.0 build
> npm-run-all build-tracker build-lang build-geo build-db build-app


> umami@1.24.0 build-tracker
> rollup -c rollup.tracker.config.js

[!] Error: Cannot find module '@rollup/plugin-buble'
Require stack:
- /home/lufi/umami/rollup.tracker.config.js
- /usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /usr/lib/node_modules/rollup/dist/bin/rollup
Error: Cannot find module '@rollup/plugin-buble'
Require stack:
- /home/lufi/umami/rollup.tracker.config.js
- /usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /usr/lib/node_modules/rollup/dist/bin/rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/home/lufi/umami/rollup.tracker.config.js:6:13)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.require.extensions.<computed> [as .js] (/usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js:560:20)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)

ERROR: "build-tracker" exited with 1.

I had to fix npm-run-all and rollup, but now I can't find a way to fix @rollup/plugin-buble. Is it also linked with the package .json dependency ?

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

You can also try using yarn instead, https://yarnpkg.com/. It usually works where npm fails.

@meepmeep
Copy link
Author

Unfortunately yarn produced the same error :

Firefly:~/umami$ yarn run build
yarn run v1.22.10
$ npm-run-all build-tracker build-lang build-geo build-db build-app
$ rollup -c rollup.tracker.config.js
[!] Error: Cannot find module '@rollup/plugin-buble'
Require stack:
- /home/lufi/umami/rollup.tracker.config.js
- /usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /usr/lib/node_modules/rollup/dist/bin/rollup
Error: Cannot find module '@rollup/plugin-buble'
Require stack:
- /home/lufi/umami/rollup.tracker.config.js
- /usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /usr/lib/node_modules/rollup/dist/bin/rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/home/lufi/umami/rollup.tracker.config.js:6:13)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.require.extensions.<computed> [as .js] (/usr/lib/node_modules/rollup/dist/shared/loadConfigFile.js:560:20)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)

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

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

You need to do a clean install with yarn install

@meepmeep
Copy link
Author

Same issue.

  • Deleted umami folder,
  • clone it again
  • create .env file with correct information
  • run yarn install and then yarn run build

I tried with umami 1.13.0 and had the same result.
I could open a different issue if you prefer as your #856 (comment) fixed the other one.

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

I had to fix npm-run-all and rollup, but now I can't find a way to fix @rollup/plugin-buble.

What do you mean by this? You shouldn't have to do anything but run install. It will install everything specified in the package.json.

@meepmeep
Copy link
Author

Sorry, i think I'm lost between npm and yarn ..

I tried on another server, and everything works fine. I must have a cache problem somewhere

@atmonshi
Copy link
Contributor

the same here.
I did:

  • downgrade eslint and stylelint as in this comment
  • run rm -rf node_modules && rm yarn.lock && yarn && yarn run build

got the error:
warn - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config

full log:

server:~/username$ yarn run build
yarn run v1.22.15
$ npm-run-all build-tracker build-lang build-geo build-db build-app
$ rollup -c rollup.tracker.config.js

tracker/index.js → public/umami.js...
created public/umami.js in 605ms
$ npm-run-all format-lang compile-lang
$ node scripts/format-lang.js
/home/username/build/ar-SA.json ✗
/home/username/build/ca-ES.json ✗
/home/username/build/cs-CZ.json ✗
/home/username/build/da-DK.json ✗
/home/username/build/de-DE.json ✗
/home/username/build/el-GR.json ✗
/home/username/build/en-GB.json ✗
/home/username/build/en-US.json ✗
/home/username/build/es-MX.json ✗
/home/username/build/fa-IR.json ✗
/home/username/build/fi-FI.json ✗
/home/username/build/fo-FO.json ✗
/home/username/build/fr-FR.json ✗
/home/username/build/he-IL.json ✗
/home/username/build/hi-IN.json ✗
/home/username/build/hu-HU.json ✗
/home/username/build/id-ID.json ✗
/home/username/build/it-IT.json ✗
/home/username/build/ja-JP.json ✗
/home/username/build/ko-KR.json ✗
/home/username/build/mn-MN.json ✗
/home/username/build/ms-MY.json ✗
/home/username/build/nb-NO.json ✗
/home/username/build/nl-NL.json ✗
/home/username/build/pl-PL.json ✗
/home/username/build/pt-BR.json ✗
/home/username/build/pt-PT.json ✗
/home/username/build/ro-RO.json ✗
/home/username/build/ru-RU.json ✗
/home/username/build/sk-SK.json ✗
/home/username/build/sl-SI.json ✗
/home/username/build/sv-SE.json ✗
/home/username/build/ta-IN.json ✗
/home/username/build/tr-TR.json ✗
/home/username/build/uk-UA.json ✗
/home/username/build/vi-VN.json ✗
/home/username/build/zh-CN.json ✗
/home/username/build/zh-TW.json ✗
/home/username/lang/ar-SA.json -> /home/username/build/ar-SA.json
/home/username/lang/ca-ES.json -> /home/username/build/ca-ES.json
/home/username/lang/cs-CZ.json -> /home/username/build/cs-CZ.json
/home/username/lang/da-DK.json -> /home/username/build/da-DK.json
/home/username/lang/de-DE.json -> /home/username/build/de-DE.json
/home/username/lang/el-GR.json -> /home/username/build/el-GR.json
/home/username/lang/en-GB.json -> /home/username/build/en-GB.json
/home/username/lang/en-US.json -> /home/username/build/en-US.json
/home/username/lang/es-MX.json -> /home/username/build/es-MX.json
/home/username/lang/fa-IR.json -> /home/username/build/fa-IR.json
/home/username/lang/fi-FI.json -> /home/username/build/fi-FI.json
/home/username/lang/fo-FO.json -> /home/username/build/fo-FO.json
/home/username/lang/fr-FR.json -> /home/username/build/fr-FR.json
/home/username/lang/he-IL.json -> /home/username/build/he-IL.json
/home/username/lang/hi-IN.json -> /home/username/build/hi-IN.json
/home/username/lang/hu-HU.json -> /home/username/build/hu-HU.json
/home/username/lang/id-ID.json -> /home/username/build/id-ID.json
/home/username/lang/it-IT.json -> /home/username/build/it-IT.json
/home/username/lang/ja-JP.json -> /home/username/build/ja-JP.json
/home/username/lang/ko-KR.json -> /home/username/build/ko-KR.json
/home/username/lang/mn-MN.json -> /home/username/build/mn-MN.json
/home/username/lang/ms-MY.json -> /home/username/build/ms-MY.json
/home/username/lang/nb-NO.json -> /home/username/build/nb-NO.json
/home/username/lang/nl-NL.json -> /home/username/build/nl-NL.json
/home/username/lang/pl-PL.json -> /home/username/build/pl-PL.json
/home/username/lang/pt-BR.json -> /home/username/build/pt-BR.json
/home/username/lang/pt-PT.json -> /home/username/build/pt-PT.json
/home/username/lang/ro-RO.json -> /home/username/build/ro-RO.json
/home/username/lang/ru-RU.json -> /home/username/build/ru-RU.json
/home/username/lang/sk-SK.json -> /home/username/build/sk-SK.json
/home/username/lang/sl-SI.json -> /home/username/build/sl-SI.json
/home/username/lang/sv-SE.json -> /home/username/build/sv-SE.json
/home/username/lang/ta-IN.json -> /home/username/build/ta-IN.json
/home/username/lang/tr-TR.json -> /home/username/build/tr-TR.json
/home/username/lang/uk-UA.json -> /home/username/build/uk-UA.json
/home/username/lang/vi-VN.json -> /home/username/build/vi-VN.json
/home/username/lang/zh-CN.json -> /home/username/build/zh-CN.json
/home/username/lang/zh-TW.json -> /home/username/build/zh-TW.json
$ formatjs compile-folder --ast build public/lang
$ node scripts/build-geo.js
Saved geo database: /home/username/public/geo/GeoLite2-Country.mmdb
$ npm-run-all copy-db-schema build-db-client
$ node scripts/copy-db-schema.js
Database type detected: mysql
Copied /home/username/prisma/schema.mysql.prisma to /home/username/prisma/schema.prisma
$ dotenv prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (2.29.1) to ./node_modules/@prisma/client in 579ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

$ next build
info  - Loaded env from /home/username/.env
info  - Checking validity of types
warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config

Failed to compile.

./components/layout/Header.js
21:11  Error: 'locale' is assigned a value but never used.  no-unused-vars

./components/metrics/FilterTags.js
18:11  Error: Missing "key" prop for element in iterator  react/jsx-key

./lib/lang.js
42:1  Error: Parsing error: Unexpected token <

./lib/queries.js
430:24  Error: 'ref' is assigned a value but never used.  no-unused-vars

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build-app" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

Try this, https://nextjs.org/docs/api-reference/next.config.js/ignoring-eslint

@atmonshi
Copy link
Contributor

Try this, https://nextjs.org/docs/api-reference/next.config.js/ignoring-eslint

I tested this locally and it worked on v1.24 👍🏽 , for my production app, I rolled back to v1.23, I'll wait for the next fix

did I add the locale to Header.js 😅 , should I PR and remove it since it's not used?

thank you.

@meepmeep
Copy link
Author

meepmeep commented Nov 22, 2021

I had the same issue as @atmonshi (#856 (comment)).
Ignoring eslint in nextjs fixed it, and 1.24.0 is now up and running :)

( @atmonshi could I close this issue ?)

@atmonshi
Copy link
Contributor

yes it’s ok
I’ll check the unused variables and open a PR if needed.

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2021

This should all be working now in v1.24.1.

@mikecao mikecao closed this as completed Nov 22, 2021
@Mini2935
Copy link

guys, this prob. needs only just update node js version to the lastest ...nothing else ...

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

4 participants