fix: properly attribute stack with fileName, removes slow leak
Co-authored-by: Brenden Palmer [email protected]
:::DO NOT USE:::
SEEMS LIKE SOURCE MAPS AND VM IS NOT WORKING PROPERLY
Summary
We found a slow leak in fastboot, upon further analysis of the heap we found that the https://github.com/evanw/node-source-map-support in https://github.com/evanw/node-source-map-support/blob/ac2c3e4c633c66931981ac94b44e6963addbe3f4/source-map-support.js#L37-L41 will increase over time by design as errors are created. If we utilize the built in source-map option in node we get better results and node will handle this weak map internally.

Before
stack with incorrect path on disk


After
stack with correct path on disk

I was chatting with @brendenpalmer and @gabrielcsapo and I think we might be able to do some sort of fall back logic like:
- detect if node >= 14 -- if so -> just call
process.setSourcEMapsEnabled(true) - if node ~ 12 -> check if CLI flag or
NODE_OPTIONSis setup - else -> do the old brokenish thing
This would both fix the bug for folks using more modern Node (14+) and continue working (with existing behavior) for folks on Node 12 without the CLI flag on or Node versions older than 12 all without being breaking (as far as I can tell).