Open gherciu opened 4 days ago
Some context: We need this fix to be able to use this package https://www.npmjs.com/package/import-fresh It is downloaded 42 million times a week, and we also need this in our project I think Bun will benefit from fixing it since a lot of people need this In our case we want to extend it a bit to remove also child imports cache, to have a truly dynamic uncached import
What version of Bun is running?
1.1.34
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
Have 2 files
a.ts and b.ts
the a imports b And in a I log thisconsole.log(require.cache)
Now in the logged info find the B module and you'll see that the parent field is undefined even tho it should not becausea imports b
Now my vscode says that.parent
is deprecated and I should use.main
but this also doesn't work On top of that the.children
also doesn't work and I can't figure out what are the child imports of some file to remove them from the cache and thus my app doesn't reload the code correctly when I needWhat is the expected behavior?
I should be able to see the parent imports of a module or which is the most important the child imports that this module imported so that I can invalidate them if needed
What do you see instead?
udenfined in all these properties
Additional information
No response