脚本启动冻结: `concurrently` + `mysql2` + `tsx watch`
I've reproduced this issue with two files: 1. The following minimal package.json: { "name": "test", "version": "0.0.1", "scripts": { "dev": "concurrently \"vite\" \"tsx watch index.ts\"", "dev-nowatch": "concurrently \"vite\" \"tsx index.ts\"", "dev-index": "tsx watch index.ts" }, "dependencies": { "mysql2": "^3.12.0" }, "devDependencies": { "concurrently": "^9.1.2", "tsx": "^4.19.2", "TypeScript": "~5.6.2", "vite": "^6.0.5" } } 2. The following file, index.ts: console.log("hello world"); import "mysql2"; With these files, run: npm i The following shows that "hello world" does not log as expected: npm run dev The following commands show that it does print when not using concurrently or when not using watch mode: npm run dev-nowatch npm run dev-index Also try commenting out import "mysql2" to see that this also works: console.log("hello world"); // import "mysql2"
内容来源: open-cli-tools/concurrently