https://codesandbox.io/s/github/nuxt/codesandbox-nuxt/tree/master/?fontsize=14
Try a few times, the memory is more than 1G
To release memory no longer grows.
```html
<--- Last few GCs --->
[44646:0x10264a000] 149203 ms: Mark-sweep 1235.2 (1425.2) -> 1234.5 (1425.7) MB, 1168.9 / 0.1 ms (average mu = 0.097, current mu = 0.043) allocation failure scavenge might not succeed
[44646:0x10264a000] 149305 ms: Scavenge 1237.1 (1426.7) -> 1235.9 (1427.7) MB, 6.8 / 0.0 ms (average mu = 0.097, current mu = 0.043) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x250efdd5be3d]
1: StubFrame [pc: 0x250efdd0d608]
2: StubFrame [pc: 0x250efe0e5e4c]
Security context: 0x07356d99e6e9
3: /* anonymous */ [0x735c23da299] [server.js:2134] [bytecode=0x735dd7c4c49 offset=221](this=0x0735c23da2d9
Memory leaks in dev mode can't be avoided. They don't appear in prod mode though, except through userland code .
@manniL meet in the production too
Actually, I managed to trigger this using yarn generate
:
```~/P/w/frontend โฏโฏโฏ yarn generate master โฌ โ โฑ โ
yarn run v1.19.1
$ nuxt-ts generate
โน Production build 10:19:58
โ Builder initialized 10:19:58
โ Nuxt files generated 10:19:58
โน Starting type checking service... nuxt:typescript 10:19:59
โน Using 4 workers with 4096MB memory limit nuxt:typescript 10:19:59
โ Client โโโโโโโโโโโโโโโโโโโโโโโโโ emitting (95%) vue-client-plugin
โฏ Server
<--- Last few GCs --->
tep 16.2 ms, walltime since start of marking 55 ms) (average mu = 0.292, current mu = 0.245) finalize i[79389:0x33c0150] 541309 ms: Mark-sweep 2047.4 (2059.7) -> 2042.3 (2054.4) MB, 15.2 / 0.0 ms (+ 30.9 ms in 33 steps since start of marking, biggest step 11.8 ms, walltime since start of marking 52 ms) (average mu = 0.217, current mu = 0.131) finalize i[79389:0x33c0150] 541322 ms: Scavenge 2043.5 (2054.4) -> 2042.3 (2060.9) MB, 2.7 / 0.0 ms (average mu = 0.217, current mu = 0.131) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x13a71b9]
Security context: 0x3a4b48f408d1 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: /* anonymous /(aka / anonymous */) [0x19ede8afa709] [/home/js/PIRC/website/frontend/node_modules/babel-code-frame/lib/index.js:~124] pc=0x22705b233297
2: arguments adaptor frame: 16->0
3: StubFrame [pc: 0x13e36ed]
4: replace [0x3a4b48f563c1](this=0x29d212600119
1: 0x9ef190 node::Abort() [/home/js/.nvm/versions/node/v12.16.1/bin/node]
2: 0x9f13b2 node::OnFatalError(char const, char const) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
3: 0xb5da9e v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
4: 0xb5de19 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
5: 0xd0a765 [/home/js/.nvm/versions/node/v12.16.1/bin/node]
6: 0xd0adf6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
7: 0xd1760a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
8: 0xd18515 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
9: 0xd19bbf v8::internal::Heap::HandleGCRequest() [/home/js/.nvm/versions/node/v12.16.1/bin/node]
10: 0xcc8715 v8::internal::StackGuard::HandleInterrupts() [/home/js/.nvm/versions/node/v12.16.1/bin/node]
11: 0x1024376 v8::internal::Runtime_StackGuard(int, unsigned long, v8::internal::Isolate) [/home/js/.nvm/versions/node/v12.16.1/bin/node]
12: 0x13a71b9 [/home/js/.nvm/versions/node/v12.16.1/bin/node]
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
@samupl
How did you solve this problem?
@AntonBazarov
I'm not sure if this is a bug in nuxtjs or webpack, BUT in my case I narrowed it down to having the dist/
directory present.
If there IS a dist/
directory existing at the time I run yarn generate
, randomly it will fail with the error above.
If I remove the dist
directory prior to running yarn generate
, the problem never appeared.
Now I don't have any statistics, but I have my builds running in docker containers, at build time. I made sure to add dist/
to .dockerignore
, and now nobody complains about this error anymore.
So - check if you have a dist/
directory. If you do, remove it and see if it helps in your case as well.
@manniL: Can this issue be reopened? I've managed to trigger this bug (see my comment above) on a fresh nuxt.js installation.
Thanks for your contribution to Nuxt.js!
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 you would like this issue to remain open:
Issues that are labeled as pending
will not be automatically marked as stale.
Currently stuck on this on a fresh install of nuxt... Is nuxt officially broken?
For anyone having this issue, please try my solution https://github.com/nuxt-community/auth-module/issues/286#issuecomment-615907089
Thanks for your contribution to Nuxt.js!
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 you would like this issue to remain open:
Issues that are labeled as pending
will not be automatically marked as stale.
I am facing the same problem. In my case the problem lies in the following auth configuration. It happens on a fresh installation of nuxt:2.14.3, and so it should be easy to reproduce the error.
I am using @nuxt/auth-next:^5.0.0-1595976864.509d9d6
Is the token 'cookie' being repeated twice causing an infinite loop?
// nuxt.config.js
auth: {
strategies: {
cookie: {
cookie: {
name: 'session',
},
endpoints: {
login: { url: '/api/login', method: 'post' },
logout: { url: '/api/logout', method: 'post' }
}
}
}
},
Most helpful comment
@manniL meet in the production too