nabla / vite-plugin-eslint

Plugs ESLint into Vite dev server
MIT License
122 stars 4 forks source link

Vite dev server not loading because of require syntax #5

Closed miachenmtl closed 2 years ago

miachenmtl commented 2 years ago

After updating to vite 2.6.14, the dev server fails on load with this error message:

Error [ERR_REQUIRE_ESM]: require() of ES Module ........../node_modules/chalk/source/index.js from .........../node_modules/@nabla/vite-plugin-eslint/worker.js not supported.

I tried replacing this plugin with the original vite-plugin-eslint@1.0.3, which uses import statements instead of require, and that works fine.

Edit: See https://github.com/vitejs/vite/issues/5694

ArnaudBarre commented 2 years ago

It's due to chalk 5 using ESM. It was a bad idea to use a wildcard for the versioning of it. I pinned it to v4 in 1.3.5