- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 544
Open
Labels
Description
In my code generator project, I watch directory and on each change do require.cache cleaning and rerequire modules from that directory.
And I use stack to implement one important feature.
var stack = new Error().stack;
var stackLines = stack.match(/[^\r\n]+/g);
console.log(stackLines[1]) 
>>>
at Object.<anonymous> (/Workspace/gener/data.js:1:13)Rerequire works fine, because each time file changes, I see that console.log, meaning file is actually rerequired.
But if I move var stack = new Error().stack; down by 5 lines, I still get:
at Object.<anonymous> (/Workspace/gener/data.js:1:13) // I get
at Object.<anonymous> (/Workspace/gener/data.js:6:13) // I should getIf I do same experiment in pure js and node - it works fine.
So the only moving part between working version and not working version is node server.js and ts-node server.js
hongikeam, chetbox, jspri, v-honcharenko, nfour and 3 moresahin52