Comments (4)
@tmorgan497 I tried your reproduction (with Docker) and HMR is working fine for me. Also, I am not seeing high CPU usage. But I am on Linux
and I suspect that Windows
might be causing the issue for you. Any chance you might develop on non-Windows OS (Linux, Mac)?
Also, I noticed that there is a directory called pv-presets
in the root of your project which is causing unnecessary file watching and possibly another cause for the high CPU usage. There are a lot of directories with lots of files inside the pv-presets
that I suspect are not needed (this is for PrimeVue, right)?
from nuxt.js.
When I set CHOKIDAR_USEPOLLING=false
, the CPU load goes way down, but then I lose HMR. And when doing development on the app, that means I have to restart the container on every change. Does anyone have a workaround? Also, my container keeps outputting nitro-runtime logs, but I can't figure out from where. When I run the app outside of docker, no nitro-runtime
logs occur. See logs below.
2024-06-14 13:02:42 Sorting candidates: 1.92ms
2024-06-14 13:02:42 Generate rules: 153.303ms
2024-06-14 13:02:42 Build stylesheet: 3.13ms
2024-06-14 13:02:42 Potential classes: 2618
2024-06-14 13:02:42 Active contexts: 2
2024-06-14 13:02:42
2024-06-14 13:02:42
2024-06-14 13:02:43 [nitro] rollup:before: 2.709s
2024-06-14 13:02:43 [nitro] types:extend: 0.019ms
2024-06-14 13:02:44 ℹ Vite client warmed up in 8616ms
2024-06-14 13:02:45 [nitro] ✔ Nuxt Nitro server built in 1391 ms
2024-06-14 13:02:45 [nitro] compiled: 0.536ms
2024-06-14 13:02:45 [nuxt] build:done: 6.517s
2024-06-14 13:02:45 ⚙ > Nitro Start (8ms)
2024-06-14 13:02:45 [nitro] dev:reload: 278.364ms
2024-06-14 13:02:47 [nitro-runtime] request: 0.66ms
2024-06-14 13:02:47 [nitro-runtime] render:html: 0.339ms
2024-06-14 13:02:47 [nitro-runtime] render:response: 0.021ms
2024-06-14 13:02:47 [nitro-runtime] beforeResponse: 0.023ms
2024-06-14 13:02:47 [nitro-runtime] dev:ssr-logs: 0.016ms
2024-06-14 13:02:47 [nitro-runtime] afterResponse: 0.788ms
2024-06-14 13:02:52 [nitro-runtime] request: 0.05ms
2024-06-14 13:02:52 [nitro-runtime] render:html: 0.425ms
2024-06-14 13:02:52 [nitro-runtime] render:response: 0.019ms
2024-06-14 13:02:52 [nitro-runtime] beforeResponse: 0.023ms
2024-06-14 13:02:52 [nitro-runtime] dev:ssr-logs: 0.009ms
2024-06-14 13:02:52 [nitro-runtime] afterResponse: 0.52ms
2024-06-14 13:02:57 [nitro-runtime] request: 0.064ms
2024-06-14 13:02:57 [nitro-runtime] render:html: 0.162ms
2024-06-14 13:02:57 [nitro-runtime] render:response: 0.025ms
2024-06-14 13:02:57 [nitro-runtime] beforeResponse: 0.016ms
2024-06-14 13:02:57 [nitro-runtime] dev:ssr-logs: 0.008ms
2024-06-14 13:02:57 [nitro-runtime] afterResponse: 0.385ms
2024-06-14 13:03:02 [nitro-runtime] request: 0.049ms
2024-06-14 13:03:02 [nitro-runtime] render:html: 0.162ms
2024-06-14 13:03:02 [nitro-runtime] render:response: 0.012ms
2024-06-14 13:03:02 [nitro-runtime] beforeResponse: 0.019ms
2024-06-14 13:03:02 [nitro-runtime] dev:ssr-logs: 0.01ms
2024-06-14 13:03:02 [nitro-runtime] afterResponse: 0.559ms
2024-06-14 13:03:07 [nitro-runtime] request: 0.066ms
2024-06-14 13:03:07 [nitro-runtime] render:html: 0.083ms
2024-06-14 13:03:07 [nitro-runtime] render:response: 0.013ms
2024-06-14 13:03:07 [nitro-runtime] beforeResponse: 0.011ms
2024-06-14 13:03:07 [nitro-runtime] dev:ssr-logs: 0.01ms
2024-06-14 13:03:07 [nitro-runtime] afterResponse: 0.367ms
2024-06-14 13:03:12 [nitro-runtime] request: 0.055ms
2024-06-14 13:03:12 [nitro-runtime] render:html: 0.074ms
2024-06-14 13:03:12 [nitro-runtime] render:response: 0.011ms
2024-06-14 13:03:12 [nitro-runtime] beforeResponse: 0.014ms
2024-06-14 13:03:12 [nitro-runtime] dev:ssr-logs: 0.011ms
2024-06-14 13:03:12 [nitro-runtime] afterResponse: 0.357ms
2024-06-14 13:03:17 [nitro-runtime] request: 0.071ms
2024-06-14 13:03:17 [nitro-runtime] render:html: 0.196ms
2024-06-14 13:03:17 [nitro-runtime] render:response: 0.014ms
2024-06-14 13:03:17 [nitro-runtime] beforeResponse: 0.025ms
2024-06-14 13:03:17 [nitro-runtime] dev:ssr-logs: 0.011ms
2024-06-14 13:03:17 [nitro-runtime] afterResponse: 0.82ms
2024-06-14 13:03:22 [nitro-runtime] request: 0.125ms
2024-06-14 13:03:22 [nitro-runtime] render:html: 0.154ms
2024-06-14 13:03:22 [nitro-runtime] render:response: 0.03ms
2024-06-14 13:03:22 [nitro-runtime] beforeResponse: 0.02ms
2024-06-14 13:03:22 [nitro-runtime] dev:ssr-logs: 0.016ms
2024-06-14 13:03:22 [nitro-runtime] afterResponse: 0.502ms
from nuxt.js.
Configuring watchers.webpack
won't do anything unless you are using builder: 'webpack'
.
You could try experimenting with experimental.watcher
:
export default defineNuxtConfig({
experimental: {
watcher: 'chokidar' // or 'chokidar-granular' or 'parcel'
},
})
from nuxt.js.
I added the following to my nuxt.config.ts with no luck. Still high CPU usage.
experimental: {
watcher: 'chokidar',
watchers: {
chokidar: {
usePolling: true,
interval: 100,
ignored: ['**/node_modules/**', '**/pv-presets/**']
}
}
},
I also ran the container on a NixOS system and I'm not getting the same high CPU usage. So maybe it's a Windows thing 🤷. Even with CHOKIDAR_USEPOLLING=true
with no explicitly excluded folders, at idle the container is using very little CPU. When I modify the app.vue and let HMR trigger, there's a tiny spike in the CPU, but then it goes back to idle on NixOS.
from nuxt.js.
Related Issues (20)
- Server (api routes) not working in new app structure HOT 5
- `Nuxt 3.12` - app broke after upgrading. Vue Router warn: No match found for location with path "/settings/account" (repeated 24 times) HOT 1
- Build failing in production (Digital Ocean) - ERROR Cannot find module '/workspace/@nuxtjs/supabase' 3.11.2 - 3.12.2 HOT 10
- Build issue: Lexical.node.mjs not found, only Lexical.prod.mjs present HOT 7
- API behind routing rule provides cryptic response HOT 6
- Documentation Improvment - All package managers throughout docs HOT 2
- Improve Nuxt auto-imports to ignore undefined name properties HOT 3
- Why can't some of my modules be placed in devDependencies?
- Add an option for adding global route middleware that will be executed before all scanned middlewares. HOT 1
- Unable to send options via `addServerHandler` HOT 1
- Default value types of runtime config overwrite global typing HOT 1
- useRequestURL is not defined HOT 2
- Server component cannot be the root element of another server component HOT 3
- Extends don't work with custom providers HOT 2
- navigateTo in statically generated site HOT 1
- `layout: false` does not remove the layout when multiple routes use the same page component HOT 3
- "The custom meta of definePageMeta does not work when all property names in the arguments are quoted." HOT 1
- NuxtLink not rendering href attribute with external prop set to true HOT 1
- app.baseURL is no longer applied to url(...) in <style> since v3.11.0 HOT 1
- `import.meta` warning after updating to 3.12.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.js.