latest `[email protected]` doesn't work well with `meow@10` (from latest `stylelint` v15.10.1)
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/[email protected]/node_modules/meow/index.js:111:9)
at translateOptions (/poc--20230714-meow-vite-plugin-checker/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/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/[email protected][email protected][email protected][email protected][email protected]/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/[email protected][email protected][email protected][email protected][email protected]/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
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
This has been slowly getting 👍🏼s and it's been a month, any update?
😬😬😬
Any updates here? Thanks
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.
Any updates? Stylelint 16 is using meow ^13.0.0. Pinning meow to version 9 is not a permanent solution.
same issue,how to resolve
same issue,how to resolve?