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

Failed parsing of .eslintrc-auto-import.json #444

Open
5 tasks done
marlass opened this issue Nov 20, 2023 · 1 comment
Open
5 tasks done

Failed parsing of .eslintrc-auto-import.json #444

marlass opened this issue Nov 20, 2023 · 1 comment

Comments

@marlass
Copy link

marlass commented Nov 20, 2023

Describe the bug

webpack + unplugin-auto-import combination sometimes fail on parsing .eslintrc-auto-import.json.

image

From quick checks I've managed to find 2 conditions for this error to occur.

  1. Sometimes eslint file is read while it's being written to (case from the screenshot).
  2. Sometimes there are multiple concurrent writes to this file. Then .eslintrc-auto-import.json is corrupted.
{
  "globals": {
      "IconPhLinkBreak": true,
      "IconPhLinkSimpleHorizontalBreak": true
    }
  }
  
      "IconHeroiconsShoppingCart20Solid": true,
      "IconPhLinkBreak": true,
      "IconPhLinkSimpleHorizontalBreak": true
    }
  }

Both of these cases fail on the parseESLint, as there isn't any try {} catch around parsing and fallback return.
There was already one issue #143 about this, but it was closed due to lack of info. Hope these details will be enough.

Not sure how to fix the file locking which I guess would be the best fix, but even error handling in JSON parsing generally helps to recover from this problem.

Reproduction

It's hard to reproduce as typical race conditions problems. I can't reproduce it locally on my machine. It only happens on the basic GH Actions runner. Maybe that's because of the slower disk and bigger chance of double write or write with read occuring at the same time.

System Info

System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 239.06 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.4.0 - ~/code/proj-devbox/.devbox/nix/profile/default/bin/node
    Yarn: 1.18.0 - ~/code/proj-devbox/.devbox/nix/profile/default/bin/yarn
    npm: 9.7.2 - ~/code/proj-devbox/.devbox/nix/profile/default/bin/npm
  Browsers:
    Chrome: 119.0.6045.159
    Safari: 17.0

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@exherb
Copy link

exherb commented Nov 27, 2023

same here

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

2 participants