Closed ianzone closed 1 year ago
Stumbled upon this and wanted to add that this is happening in a fresh vite v4 project.
I'm facing the same issue with Vite@3 and Vite@4.
Workarround: When using vite-plugin-stylelint with Vite@4 and vite-plugin-stylelint@3.3.3 the installation process throws a warning but still functions correclty.
Can you please try v4.0.2? @ianzone @PodaruDragos @felixranesberger
Dynamic require is a doom to me, really...
Hi, thanks for your fast response. What version do I need to install?
The latest version of Vite is currently 4.0.1
Do you mean 4.0.0-beta.2?
vite-plugin-stylelint v4.0.2 actually
Works like a charm, thanks for the help!
@ianzone @PodaruDragos Can you please try the new version of vite-plugin-stylelint and tell me if it is fine? Thanks!
@ianzone @PodaruDragos Can you please try the new version of vite-plugin-stylelint and tell me if it is fine? Thanks!
HI, it works perfectly, THX
@ModyQyW works fine with 4.0.4
, thanks for the quick fix, really appreciated it.
描述问题
failed to load config from /home/ian/acte/roomzz-v1/admin_ts/vite.config.ts error when starting dev server: Error: Dynamic require of "tty" is not supported at file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite-plugin-stylelint@4.0.1_hdr6qhp2cp4t47liatlblyjedi/node_modules/vite-plugin-stylelint/dist/index.js:1:376 at file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite-plugin-stylelint@4.0.1_hdr6qhp2cp4t47liatlblyjedi/node_modules/vite-plugin-stylelint/dist/index.js:1:853 at file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite-plugin-stylelint@4.0.1_hdr6qhp2cp4t47liatlblyjedi/node_modules/vite-plugin-stylelint/dist/index.js:1:491 at file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite-plugin-stylelint@4.0.1_hdr6qhp2cp4t47liatlblyjedi/node_modules/vite-plugin-stylelint/dist/index.js:1:2468 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:530:24) at async loadConfigFromBundledFile (file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite@4.0.1_p56klvi3zg3u723wp3set4h7pe/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:63052:21) at async loadConfigFromFile (file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite@4.0.1_p56klvi3zg3u723wp3set4h7pe/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:62937:28) at async resolveConfig (file:///home/ian/acte/roomzz-v1/admin_ts/node_modules/.pnpm/vite@4.0.1_p56klvi3zg3u723wp3set4h7pe/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:62558:28) ELIFECYCLE Command failed with exit code 1.
复现
my vite.config.ts setting is
import react from "@vitejs/plugin-react-swc"; import { resolve } from 'path'; import eslintPlugin from 'vite-plugin-eslint'; import stylelintPlugin from 'vite-plugin-stylelint'; import { defineConfig } from 'vitest/config';
export default defineConfig({ test: { globals: true, environment: 'happy-dom', }, plugins: [ react(), stylelintPlugin(), eslintPlugin() ], resolve: { alias: { src: resolve(__dirname, 'src'), }, }, });
系统信息
使用的包管理器
pnpm
核对