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

latest vite-plugin-checker@0.6.1 doesn't work well with meow@10 (from latest stylelint v15.10.1) #260

Open
2 tasks done
tryforceful opened this issue Jul 14, 2023 · 6 comments · May be fixed by #294
Open
2 tasks done

Comments

@tryforceful
Copy link

Describe the bug

The latest Stylelint v15.10.1 now uses meow@^10, updating to that version to remove a recently announced semver vulnerability from the dependency tree.

However, using meow@10 with the latest vite-plugin-checker generates errors for me when trying to build with Vite:

TypeError [Error]: The `importMeta` option is required. Its value must be `import.meta`.
    at meow (/poc--20230714-meow-vite-plugin-checker/node_modules/.pnpm/meow@10.1.5/node_modules/meow/index.js:111:9)
    at translateOptions (/poc--20230714-meow-vite-plugin-checker/node_modules/.pnpm/vite-plugin-checker@0.6.1_stylelint@15.10.1_typescript@5.0.2_vite@4.4.0_vue-tsc@1.8.3/node_modules/vite-plugin-checker/dist/esm/checkers/stylelint/options.js:5:18)
    at Object.configureServer (/poc--20230714-meow-vite-plugin-checker/node_modules/.pnpm/vite-plugin-checker@0.6.1_stylelint@15.10.1_typescript@5.0.2_vite@4.4.0_vue-tsc@1.8.3/node_modules/vite-plugin-checker/dist/esm/checkers/stylelint/main.js:34:39)
    at MessagePort.<anonymous> (/poc--20230714-meow-vite-plugin-checker/node_modules/.pnpm/vite-plugin-checker@0.6.1_stylelint@15.10.1_typescript@5.0.2_vite@4.4.0_vue-tsc@1.8.3/node_modules/vite-plugin-checker/dist/esm/worker.js:57:26)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:323:10)
    at [kOnMessage] (node:internal/worker:334:37)
    at MessagePort.<anonymous> (node:internal/worker:229:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)

It seems likely to me that the reason is because the breaking changes to meow@10 are that the package is fully ESM now:
https://github.com/sindresorhus/meow/releases/tag/v10.0.0

Using meow@9 doesn't generate this error for me.

Reproduction

See minimal repro at this repo: https://github.com/tryforceful/poc--20230714-meow-vite-plugin-checker

Try to build that package with pnpm i; pnpm dev and it will generate the above error.

If you comment out these lines in the vite.config.js which enable vite-plugin-checker:

    // Comment me out to disable the error
    checker({
      stylelint: {
        lintCommand: 'stylelint ./src/style.css',
      },
    })

the error also goes away, showing that vite-plugin-checker is having difficulty using the implicit dependency meow@10 from stylelint.

Note that running stylelint alone in this repo also works fine.

Expected behavior

I expect no error when running pnpm dev while using the latest vite-plugin-checker and stylelint (v15.10.1)

System Info

System:
    OS: macOS 12.6.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 245.20 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.2.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.6 - /usr/local/bin/npm
    pnpm: 8.6.7 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 15.6.1
  npmPackages:
    vite-plugin-checker: 0.6.1 => 0.6.1

Additional context

See #255 where upgrading meow is also being requested

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@tryforceful
Copy link
Author

This has been slowly getting 👍🏼s and it's been a month, any update?

@tryforceful
Copy link
Author

😬😬😬

@Reloaded2
Copy link

Any updates here? Thanks

@jeron-diovis
Copy link

jeron-diovis commented Nov 8, 2023

For those who's waiting for this fix, for time being you can bypass this with explicit deps overriding.

With yarn:

"resolutions": {
  "meow": "^9.0.0"
}

With npm it's overrides.

@strawberry-choco
Copy link

Any updates? Stylelint 16 is using meow ^13.0.0. Pinning meow to version 9 is not a permanent solution.

@Miofly
Copy link

Miofly commented May 15, 2024

same issue,how to resolve

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

Successfully merging a pull request may close this issue.

5 participants