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

[Bug]: TypeError: Error while loading rule 'react/prefer-stateless-function': [[GeneratorState]] is not present on O #3627

Closed
2 tasks done
know7no opened this issue Aug 29, 2023 · 9 comments
Labels

Comments

@know7no
Copy link

know7no commented Aug 29, 2023

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

When I executed eslint src --ext js jsx ts tsx , the teminal throw out the 'react/prefer-stateless-function' error

ESLint: 8.21.0

TypeError: Error while loading rule 'react/prefer-stateless-function': [[GeneratorState]] is not present on O

eslint src --ext js jsx ts tsx

Expected Behavior

I found out that there is no problem when I use v7.32.1 , hope fix this problem

eslint-plugin-react version

v7.32.2

eslint version

8.21.0

node version

16.14.0

@know7no know7no added the bug label Aug 29, 2023
@know7no know7no changed the title [Bug]: [Bug]: TypeError: Error while loading rule 'react/prefer-stateless-function': [[GeneratorState]] is not present on O Aug 29, 2023
@ljharb
Copy link
Member

ljharb commented Aug 29, 2023

Duplicate of #3624. Root cause: es-shims/iterator-helpers#4

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
@ljharb
Copy link
Member

ljharb commented Aug 29, 2023

In the case of #3624, it was caused by yarn dependency resolution bugs. What package manager cli are you using?

@know7no
Copy link
Author

know7no commented Aug 30, 2023

I'm using yarn V1.22.19.

@ljharb
Copy link
Member

ljharb commented Aug 30, 2023

In that case, I suspect a yarn resolution bug - ^1.0.5 of es-iterator-helpers is required, but somehow v1.0.3 gets installed. Does that match your node_modules?

@know7no
Copy link
Author

know7no commented Aug 30, 2023

No, I got V1.0.14 installed. It looks ok.

@ljharb
Copy link
Member

ljharb commented Aug 30, 2023

oh sorry, i meant internal-slot :-)

@know7no
Copy link
Author

know7no commented Aug 30, 2023

You are absolutely right, thanks a lot.
I did install internal-slot@1.0.3, when I execute yarn command.
After I put internal-slot@1.0.5 in devDependencies which I think is as same as in the resolution field , the problem is fixed.

@mckelveygreg
Copy link

Ran into this problem as well, with yarn berry, running yarn dedupe internal-slot help clear everything up!

@know7no
Copy link
Author

know7no commented Oct 18, 2023

Ran into this problem as well, with yarn berry, running yarn dedupe internal-slot help clear everything up!

A smart way to fixed this problem.
When you use yarnV1, you can use npx yarn-deduplicate yarn.lock to do this as well.

Acconut added a commit to tus/tus-js-client that referenced this issue Nov 22, 2023
Acconut added a commit to tus/tus-js-client that referenced this issue Nov 22, 2023
* Bump the npm group with 10 updates

Bumps the npm group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [@babel/cli](https://github.com/babel/babel/tree/HEAD/packages/babel-cli) | `7.23.0` | `7.23.4` |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.23.0` | `7.23.3` |
| [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) | `7.22.15` | `7.23.3` |
| [@babel/plugin-syntax-jsx](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-jsx) | `7.22.5` | `7.23.3` |
| [@babel/plugin-transform-modules-commonjs](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-modules-commonjs) | `7.23.0` | `7.23.3` |
| [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.22.20` | `7.23.3` |
| [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) | `2.28.1` | `2.29.0` |
| [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) | `6.7.1` | `6.8.0` |
| [prettier](https://github.com/prettier/prettier) | `3.0.3` | `3.1.0` |
| [puppeteer](https://github.com/puppeteer/puppeteer) | `21.3.6` | `21.5.2` |


Updates `@babel/cli` from 7.23.0 to 7.23.4
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.4/packages/babel-cli)

Updates `@babel/core` from 7.23.0 to 7.23.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-core)

Updates `@babel/eslint-parser` from 7.22.15 to 7.23.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.3/eslint/babel-eslint-parser)

Updates `@babel/plugin-syntax-jsx` from 7.22.5 to 7.23.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-plugin-syntax-jsx)

Updates `@babel/plugin-transform-modules-commonjs` from 7.23.0 to 7.23.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-plugin-transform-modules-commonjs)

Updates `@babel/preset-env` from 7.22.20 to 7.23.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-preset-env)

Updates `eslint-plugin-import` from 2.28.1 to 2.29.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.28.1...v2.29.0)

Updates `eslint-plugin-jsx-a11y` from 6.7.1 to 6.8.0
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/CHANGELOG.md)
- [Commits](jsx-eslint/eslint-plugin-jsx-a11y@v6.7.1...v6.8.0)

Updates `prettier` from 3.0.3 to 3.1.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.0.3...3.1.0)

Updates `puppeteer` from 21.3.6 to 21.5.2
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](puppeteer/puppeteer@puppeteer-v21.3.6...puppeteer-v21.5.2)

---
updated-dependencies:
- dependency-name: "@babel/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@babel/plugin-syntax-jsx"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@babel/plugin-transform-modules-commonjs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-jsx-a11y
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: puppeteer
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix issues as reported in jsx-eslint/eslint-plugin-react#3627 with yarn-deduplicate

* Fix linting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Kleidl <marius@transloadit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants