The purpose of this is to remind myself what to do next time I encounter this error with Webpacker.
Heres the full error I was receiving when running
./bin/webpack-dev-server, no I have no idea how it got into this state. It also persisted in this state through multiple machine resets and I wrangled with this for over an hour.
This stack overflow posts recommends a couple fixes including settings the max stack size. No dice. Still didnt work. I tried a number of other node specific fixes. Nothing.
So what was the fix then? Remove the cache. Webpacker internally stores a cache in
tmp/cache/webpacker for faster reading / writing operations so it doesnt have to fully bundle all your assets and uses the cache to speed things up.
Because I was quite annoyed by this point, I just nuked the whole thing.
rm -rf tmp/cache
Bam. Call it a day. I fired up
./bin/webpack-dev-server and all was hunky dory in the land of Rails.