styled-components: v6 crashes `tsc` (OOM)
Environment
System:
- OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
- CPU: (4) x64 AMD EPYC Processor
- Memory: 5.66 GB / 7.57 GB
- Container: Yes
- Shell: 5.1.16 - /bin/bash
Binaries:
- Node: 20.3.0 - ~/.nvm/versions/node/v20.3.0/bin/node
- Yarn: 1.22.19 - ~/.nvm/versions/node/v20.3.0/bin/yarn
- npm: 9.7.1 - ~/.nvm/versions/node/v20.3.0/bin/npm
- pnpm: 8.6.5 - ~/.nvm/versions/node/v20.3.0/bin/pnpm
npmPackages:
- styled-components: 6.0.0 => 6.0.0
Steps to reproduce
npx tsc
v5 works, v6 crashes. Tested with TypeScript v5.1.5 and v5.0.4.
Expected Behavior
No errors.
Actual Behavior
<--- Last few GCs --->
[36408:0x6e45340] 38728 ms: Mark-Compact (reduce) 1881.5 (1966.8) -> 1881.5 (1919.3) MB, 1080.72 / 0.00 ms (average mu = 0.400, current mu = 0.000) last resort; GC in old space requested
[36408:0x6e45340] 39784 ms: Mark-Compact (reduce) 1881.5 (1919.3) -> 1881.5 (1919.3) MB, 1055.64 / 0.00 ms (average mu = 0.243, current mu = 0.000) last resort; GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0xc8e4a0 node::Abort() [node]
2: 0xb6b8f3 [node]
3: 0xeacb10 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
4: 0xeacdf7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
5: 0x10ad8ba v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
6: 0x1089bd6 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
7: 0x107b21c v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [node]
8: 0x107b384 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [node]
9: 0x13aa25d v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [node]
10: 0x13aa303 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [node]
11: 0x14daf23 v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x7fa125e99ef6
Aborted (core dumped)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 14
- Comments: 25 (9 by maintainers)
Im also experiencing this
Running latest styled-components in Github Actions, with latest Nextjs
Just want to let everyone know I’m going to continue looking into this, I’ve been moving houses this weekend so busy busy!
Seeing crashes on this as well on CI.
Also TS is painfully slow in editor (VS Code) post
6.0.0-rc.6release version.I tried to dedupe
@types/reactwith yarn resolutions but it didn’t help.However I found out it first appeared in version 6.0.0, version 6.0.0-rc.6 is fine even with non-deduped
@types/reactHi there, just wanted to chip in to tell I’m also running into this issue after upgrading to v6, is this still being worked on? This is on a large project as well.
I also have only one version of
@types/reactin my lockfile.tscis still taking ~30 seconds with v6 vs ~3 seconds with v5 on my computer, using upwards of 6GB of RAM, and failing with OOM on CircleCI.We will need to start using react v18 types internally soon. Maybe will ship that as a patch or add it to peerDependencies with a permissive range so it dedupes better.
Just to add to this, running TSC locally on my macbook which has 64GB of RAM, it ran fine. It only is failing once in Github Actions CI which has a lot less RAM allocation, so assuming this is a memory leak with large applications (like ours).