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

Assertion Failure in fsevents When Using @pandacss/eslint-plugin with eslint-plugin-jsx-a11y and ESLint Cache #170

Closed
taichi221228 opened this issue Oct 24, 2024 · 2 comments

Comments

@taichi221228
Copy link

Environment:

  • Node.js: 22.3.0
  • pnpm: 9.12.1
  • ESLint: ^9.13.0
  • eslint-plugin-react: ^7.37.2
  • eslint-plugin-jsx-a11y: ^6.10.1
  • @pandacss/eslint-plugin: ^0.2.0

Description:

In a pnpm environment using ESLint's Flat Config with a React setup, I encounter an assertion failure in fsevents when running ESLint multiple times with the --cache option. This occurs specifically when using both @pandacss/eslint-plugin and eslint-plugin-jsx-a11y together.

Error Message:

eslint --cache .

Assertion failed: (napi_create_external(env, fseenv, fse_environment_destroy, NULL, &result) == napi_ok), function fse_environment_create, file fsevents.c, line 87.
[1]    54618 abort      eslint --cache .

Observations:

  • The issue does not occur when using either plugin individually.
  • When @pandacss/eslint-plugin is configured, the error only occurs with the --cache option.
  • Simply importing @pandacss/eslint-plugin without configuring it causes the error, even without the --cache option.

Steps to Reproduce:

  1. Configure ESLint with @pandacss/eslint-plugin:

    import pandaPlugin from "@pandacss/eslint-plugin";
    
    export const pandaConfigs = [
      {
        plugins: { "@pandacss": pandaPlugin },
        rules: pandaPlugin.configs.recommended.rules,
      },
    ];
  2. Run ESLint without cache (No Error):

    eslint .
    
    /path/to/src/App.tsx
      8:7  warning  Unnecessary debug utility  @pandacss/no-debug
    
    ✖ 1 problem (0 errors, 1 warning)
  3. Run ESLint with cache (Error Occurs):

    eslint --cache .
    
    /path/to/src/App.tsx
      8:7  warning  Unnecessary debug utility  @pandacss/no-debug
    
    ✖ 1 problem (0 errors, 1 warning)
    
    Assertion failed: (napi_create_external(env, fseenv, fse_environment_destroy, NULL, &result) == napi_ok), function fse_environment_create, file fsevents.c, line 87.
     ELIFECYCLE  Command failed.
    [1]    37634 abort      pnpm lint.cache
  4. Importing Without Configuration (Error Occurs Without Cache):

    // The error occurs just by importing without setting up the plugin.
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    import pandaPlugin from "@pandacss/eslint-plugin";
    
    export const pandaConfigs = [];
    eslint .
    
    Assertion failed: (napi_create_external(env, fseenv, fse_environment_destroy, NULL, &result) == napi_ok), function fse_environment_create, file fsevents.c, line 87.
    [1]    37161 abort      eslint .

Minimal Reproducible Environment

A repository demonstrating the issue can be found here: panda-eslint-plugin-bug


Additional Information:

  • The issue seems related to the interaction between @pandacss/eslint-plugin, eslint-plugin-jsx-a11y, and ESLint's caching mechanism.
  • Removing either plugin or disabling cache prevents the error from occurring.
  • The error points to an assertion failure in fsevents, specifically in fsevents.c at line 87.

Behavior:

Expected:

  • ESLint should run without errors when both plugins are used together, regardless of the cache option.

Actual:

  • ESLint aborts with an assertion failure in fsevents when both plugins are used together with the cache option enabled.

Request:

  • Assistance in identifying the cause of this issue and a potential fix or workaround.
@taichi221228 taichi221228 changed the title Assertion Failure in fsevents When Using @pandacss/eslint-plugin with eslint-plugin-jsx-a11y and ESLint Cache Assertion Failure in fsevents When Using @pandacss/eslint-plugin with eslint-plugin-jsx-a11y and ESLint Cache Oct 24, 2024
@anubra266
Copy link
Collaborator

@taichi221228 I could not reproduce this
CleanShot 2024-10-24 at 08 57 31@2x

From what I know; fsevents is a macOS-only library used to handle file system events.

You could try removing node_modules and reinstalling.
Or rebuild modules with pnpm rebuild

Otherwise it could be that your node version is incompatible with version of fsevents in project.

These are where it's used
CleanShot 2024-10-24 at 09 01 52@2x

@taichi221228
Copy link
Author

taichi221228 commented Nov 12, 2024

@anubra266 Thank you for your help.

After trying various things, I was able to resolve the issue by deleting the mise shims and ~/.cache/node/corepack/v1/pnpm/9.12.1/**.

As you mentioned, it seems the inconsistency between Node.js and pnpm was the cause.

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