-
Notifications
You must be signed in to change notification settings - Fork 84
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
Potential CPU usage issues with typescript/eslint #72
Comments
+1 here. node process running at 99.9% pushing MBA M1 to 70-80 degrees. Solved when deactivating the plugin. |
|
I have this issue too, I had to disable meanwhile. It literally kicked the fans of the laptop at 100%. |
Same here on Intel iMac running macOS
is used in the configuration of |
+1 can downgrading versions help? |
Sorry for the late response. Could anybody provide a minimal reproduction repository? |
I guses maybe this is related to some wrong internal ESLint configuration inside the checker. |
We are facing the same issue. I tried to create a minimal reproduction repository today without any success. @fi3ework If you have any suggestions what could be causing this issue I would be happy to try to reproduce the issue. Regarding your suspicion that this issue could be related to eslint, I have to say that we are not using eslint with typechecker: {
plugins: [
mkcert(),
PkgConfig(),
OptimizationPersist(),
Checker({ typescript: true}),
react(),
tsconfigPaths(),
]
} However we do use eslint separately in this project, just not with this plugin. |
@LukasMarx Would you like to give it a try to upgrade to 0.4.0 if you are using 0.3.x? Many bugs are fixed in 0.4.0 and I don't know whether this is also fixed as I can't reproduce it till now 😔 |
@LukasMarx could you use |
@LukasMarx You can take a look at my minimal test example: https://github.com/fi3ework/vite-plugin-checker/tree/main/playground/react-ts. And provide the information you suspect such as customized tsconfig, monorepo etc. and I would like to reproduce on my machine. |
Here is our tsconfig.json {
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"paths": {
"translations/*": ["./src/translations/*"],
"shared": ["./src/shared/index.ts"],
"config/*": ["./src/config/*"],
"shared/*": ["./src/shared/*"],
},
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noImplicitAny": false
},
"include": ["src", "jest.config.ts", "src/Cypress.d.ts"],
"exclude": ["node_modules", "assets", "out", "build"]
} And here is the vite.config.ts: import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import Checker from "vite-plugin-checker";
import OptimizationPersist from "vite-plugin-optimize-persist";
import PkgConfig from "vite-plugin-package-config";
import mkcert from "vite-plugin-mkcert";
import react from "@vitejs/plugin-react";
export default defineConfig(({ mode }) => {
return {
optimizeDeps: {
include: ["react-grid-layout", "@mui/material"],
},
base: "./",
build: {
outDir: "build",
reportCompressedSize: false,
sourcemap: true,
},
plugins: [
mkcert(),
PkgConfig(),
OptimizationPersist(),
Checker({ typescript: true }),
react(),
tsconfigPaths(),
],
resolve: {
alias: {
"react/jsx-runtime":
"../../node_modules/react/cjs/react-jsx-runtime.production.min.js",
},
},
json: {
namedExports: false,
stringify: true,
},
server: {
https: true,
},
define: {
"process.env": {},
},
};
}); Let me know if you need more information. I will try to come up with more ideas and reproduce this issue. Thank you for your help! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a bug report, please provide a minimal re-production repository or use path to reproduce. Thank you for your contributions. |
not stale |
This is still an issue, it does exist even in the newest version. |
The issue is probably not in this plugin since disabling the TypeScript support solves the problem and running |
Also following this guide and changing how TLDR: Adding an env variable |
update I think
@raszi Nice catch. Maybe it should be added to the worker env by default for the typescript checker. |
@fi3ework I experience the same issue, but with this configuration
This watcher creation takes about 40s and watcher itself consumues a lot of CPU resources on each HMR update |
I've noticed that since after I enabled this plugin, the CPU usage of the node process went up to 100% and my fans started to go crazy.
The node CPU usage starts to increase after a few compilation/checks.
I have problems to identify the issue any further. This is the behaviour if I have this plugin enabled. So I'm afraid I cant put any more details to it. I'm mostly creating this issue to see if there's anyone else experiencing the same issue?
The text was updated successfully, but these errors were encountered: