Loading Slice Simulator page causes Javascript heap out of memory errors

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?

Oh, just so it's clear, NX serves on port 4200, not port 3000. So it's not a question of going to the wrong port.

EDIT: OK, FWIW, it's not so much that it was the complexity (though there's still some weirdness there), but it appears if ANYTHING errors out in trying to compile, it just runs out of memory. By checking and fixing some errors, it began to work properly, but it seems the error handling of slice-simulator is leaving a little to be desired.

Hi @jason.clark,

Thanks for reaching out.

I'm happy to hear that you have been able to fix the issue, have figured out what was causing the issue, and there is an easy way t reproduce it?

This can be reproduced by adding a bug to the slice-simulator.vue file. For instance:

import state from '~~/.slicemachine/libraries-state.json'