First, I'm seeing this only when using slightly more complicated slices that have 10+ fields in primary. Also, it's possible this is due to my environment, but it seems like it should work properly. So, my environment is this:
Slice Machine created as a Next.js application in an NX monorepo. .slicemachine
is at the root of the monorepo, not at the root of the Next.js app. I'm running this in WSL2 using Ubuntu 20.04 on top of Windows 11, with 16GB of RAM and 8 cores provided to the WSL instance.
In order to run the simulator, I have to run nx serve slice-simulator
which starts up fine and registers with Next.js properly. However, once I have a more complicated slice in the code, whenever I try to go to http://localhost:4200/slice-simulator
, I get a HUGE bump in RAM usage (like from 5GB to over 11GB) on my WSL instance and eventually a FATAL ERROR: Reached heap limit Allocation failed - Javascript heap out of memory
error in my terminal, and the process crashes.
I'm not sure if Slice Simulator doesn't like living in an NX monorepo, or what the deal is, but it makes it totally unusable for me. I'm going to try creating a basic next app with just slice simulator and see how that works, but if that's the answer, it's the wrong answer because we do everything in our monorepo.
Any ideas?