Closed marionebl closed 5 years ago
same issue in eslint: https://github.com/eslint/eslint/pull/11066
friendly ping @sindresorhus
Can you try out v3.0.0? It improves the logic for finding the module to clear.
seems not, I've upgrade to import-fresh@3.0.0
, but getting another error: https://ci.appveyor.com/project/nzakas/eslint/builds/21226625
oops it's working, thanks for fixing this!
@sindresorhus seems the issue could be closed!
Great!
In certain conditions
import-fresh
fails with the error messagePath must be a string. Received null
on Node 8.Example build: travis/commitlint#L1738
Digging deeper reveals this is caused by
caller-path
returning aCallsite
that returns null from itsgetFileName
method: caller-path/index.js#L4This in turn is caused by
caller-callsite
returning always the very firstCallsite
it finds by breaking out of the iteration here: caller-callsite/index.js#L13Removing the
break
statement fixes the issue for me - I am not familiar with the APIs used here, so I am not very confident this is the appropriate fix though.Steps to reproduce