Closed RijaCloud closed 10 months ago
We've experienced this recently on our CI. Relevant issues: https://github.com/actions/runner-images/issues/70 and https://github.com/vitejs/vite/issues/2433
Solved by increasing --max-old-space-size=16384
in the github action.
Hi @hymair , thank you for the answer. But what may be the origin of the heap ?
We've experienced this recently on our CI. Relevant issues: actions/runner-images#70 and vitejs/vite#2433
Solved by increasing
--max-old-space-size=16384
in the github action.
I tried this but still the same problem, also I don't understand why do I have this error :
WARN Could not resolve import "@babel/runtime/helpers/esm/defineProperty.js" in C:\Users\User\Documents\maj\front-maj\.nuxt\dist\server\_nuxt\collection-info-stepper.d68cd38f.js using exports defined in C:\Users\User\Documents\maj\front-maj\node_modules\@babel\runtime\package.json.
Also how do you set the --max-old-space-size=16384
? @hymair . Thx :)
I was able to resolve this on Digital Ocean by decreasing the heap size with the following build command in package.json
:
"build": "node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.mjs build"
Hi. I see you move my #21458 problem to here.
In my platform we don't have a missing babel
modules and the code is works but with high memory usage. so the problem is "near".
Thanks for all.
Hi! I'm not sure if it's the same problem but I can't deploy in Netlify after v3.6.
If I lock nuxt in v3.5.3 or remove one of the modules it deploys without problems.
Reproduction repo: https://github.com/emaia/test-netlify
8:47:40 PM: Functions bundling
8:47:40 PM: ────────────────────────────────────────────────────────────────
8:47:40 PM:
8:47:40 PM: Packaging Functions from .netlify/functions-internal directory:
8:47:40 PM: - server/server.mjs
8:47:40 PM:
8:47:59 PM: <--- Last few GCs --->
8:47:59 PM: [3762:0x75d22b0] 23133 ms: Scavenge 2004.0 (2039.7) -> 2003.7 (2050.7) MB, 5.0 / 0.0 ms (average mu = 0.155, current mu = 0.125) allocation failure;
8:47:59 PM: [3762:0x75d22b0] 25182 ms: Mark-sweep 2044.3 (2084.3) -> 2021.8 (2060.9) MB, 2029.7 / 0.0 ms (average mu = 0.093, current mu = 0.021) allocation failure; scavenge might not succeed
8:47:59 PM: [3762:0x75d22b0] 25198 ms: Scavenge 2029.7 (2060.9) -> 2030.6 (2084.9) MB, 12.5 / 0.0 ms (average mu = 0.093, current mu = 0.021) allocation failure;
8:47:59 PM: <--- JS stacktrace --->
8:47:59 PM: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
8:47:59 PM: 1: 0xb7a940 node::Abort() [/opt/buildhome/node-deps/node]
8:47:59 PM: 2: 0xa8e823 [/opt/buildhome/node-deps/node]
8:47:59 PM: 3: 0xd5c990 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
8:47:59 PM: 4: 0xd5cd37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
8:47:59 PM: 5: 0xf3a435 [/opt/buildhome/node-deps/node]
8:47:59 PM: 6: 0xf3b338 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/opt/buildhome/node-deps/node]
8:47:59 PM: 7: 0xf4b843 [/opt/buildhome/node-deps/node]
8:47:59 PM: 8: 0xf4c6b8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/buildhome/node-deps/node]
8:47:59 PM: 9: 0xf4f885 v8::internal::Heap::HandleGCRequest() [/opt/buildhome/node-deps/node]
8:47:59 PM: 10: 0xecd9df v8::internal::StackGuard::HandleInterrupts() [/opt/buildhome/node-deps/node]
8:47:59 PM: 11: 0x12ce115 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/node-deps/node]
8:47:59 PM: 12: 0x16fb6f9 [/opt/buildhome/node-deps/node]
8:48:01 PM: /opt/build-bin/build: line 124: 3762 Aborted (core dumped) FORCE_COLOR=1 $netlify_build_node_bin $netlify_build_bin --cwd=$repository_root --repositoryRoot=$repository_root --config=$configuration_file_path --branch=$branch --siteId=$site_id --defaultConfig=$default_config --baseRelDir=$base_rel_dir --context=$context --node-path=$user_node_path --cachedConfigPath=$cached_netlify_build_config_file --api-host=$netlify_endpoint --token=$netlify_token --build-id=$BUILD_ID --deploy-id=$DEPLOY_ID --mode=buildbot --telemetry=$build_telemetry --send-status --save-config --statsd.host=$DATADOG_HOST --statsd.port=$STATSD_PORT --tracing.enabled=$tracing_enabled --tracing.host=$DATADOG_HOST --tracing.traceId=$trace_id --tracing.parentSpanId=$parent_span_id --tracing.traceFlags=$trace_flags --functions-dist-dir=$functions_dist_dir --edge-functions-dist-dir=$edge_functions_dist_dir --cache-dir=$cache_dir --buildbot-server-socket=$buildbot_server_socket --framework=$framework --feature-flags=$feature_flags --testOpts.silentLingeringProcesses=$SILENT_LINGERING_PROCESSES --system-log-file=$system_log_file
8:48:02 PM: Error running command: Build script returned non-zero exit code: 134
8:48:03 PM: Failing build: Failed to build site
8:48:03 PM: Finished processing build request in 54.448s
Hi! We also encounter the memory usage issue on Netlify, but also on a local machine memory usage builds up very quick. Already set Netlify to use 8192MB (with NODE_OPTIONS --max-old-space-size=8192) but still runs out of memory. We do generate a lot of pages (over 4000). We tried to set the Nitro option concurrency in prerender to 1 (and a lot of other values), but still gives the issue.
At this moment we cannot use Nuxt 3 (3.6.5) + Nitro on Netlify. But works fine with Nuxt 2. Hope someone finds a resolution soon, but I think more people encounter this at the moment.
Hi! We also encounter the memory usage issue on Netlify, but also on a local machine memory usage builds up very quick. Already set Netlify to use 8192MB (with NODE_OPTIONS --max-old-space-size=8192) but still runs out of memory. We do generate a lot of pages (over 4000). We tried to set the Nitro option concurrency in prerender to 1 (and a lot of other values), but still gives the issue.
At this moment we cannot use Nuxt 3 (3.6.5) + Nitro on Netlify. But works fine with Nuxt 2. Hope someone finds a resolution soon, but I think more people encounter this at the moment.
@martijnloavies I'm encountering the same issue.
@martijnloavies this temporary solved for me: https://github.com/nuxt/nuxt/issues/22257#issuecomment-1666680796
Add this to Nuxt config. It works for me
postcss: { plugins: { tailwindcss: {}, autoprefixer: {}, cssnano: process.env.NODE_ENV === 'production' ? { preset: ['default', { discardComments: { removeAll: true } }] } : false, // disable cssnano when not in production }, }
Thank you @martijnloavies
Add this to Nuxt config. It works for me
postcss: { plugins: { tailwindcss: {}, autoprefixer: {}, cssnano: process.env.NODE_ENV === 'production' ? { preset: ['default', { discardComments: { removeAll: true } }] } : false, // disable cssnano when not in production }, }
Thank you @martijnloavies
Thank you! @htphongx4
Closing as this is not a Nuxt issue but a cssnano
bug.
close
What?, how you close this ticket when there a lot of there tickets closed and point to this ticket without solution?!
It is closed as it is a cssnano bug add needs to be resolved there, not in Nuxt.
The workaround is just two comments up: https://github.com/nuxt/nuxt/issues/18507#issuecomment-1684691350
It is closed as it is a cssnano bug add needs to be resolved there, not in Nuxt.
The workaround is just two comments up: #18507 (comment)
the issue still appear in nuxt by default! if issue happen in one of your dependencies that don't mean it resolved for you
Hello folks. I have a bunch of JSON files (20MB), which are supposed to be dynamically imported. After I added this code I started getting Heap error FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
for nuxt generate
. I expanded max-old-space-size=16384
, but instead of an error, the building process freezes.
const country = 'NL'
const cities = await import(`../../../assets/countryData/${country}.json`)
Have same issue, cssnano didn't solved it
@Bredansky probably related to https://github.com/vitejs/vite/issues/2433
Got this issue on Vercel. Won't build properly. Very annoying.
EDIT: Switching form Yarn to PNPM did the trick for me.
Environment
Windows_NT
v18.12.1
3.0.0
1.0.0
npm@9.2.0
vite
app
,build
,modules
,proxy
,css
,vite
,i18n
,runtimeConfig
,plugins
,components
@nuxtjs/i18n@8.0.0-beta.7
,nuxt-proxy@0.3.4
Build Modules:
-
Reproduction
Honnestly, I truly don't know how to reproduce this issue. It only happens when i build my application. But i hope you can give me some hint about what may the reason behind it
Here are the informations i can give :
package.json
nuxt.config.js
Describe the bug
When I run
npm run build
, things seemingly working well but after some time more logs appear in the console .WARN Could not resolve import @babel .....
Additional context
No response
Logs