You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the situation where after bundling with Rollup I get an error when trying to resolve a config file through cosmiconfig and traced the error back to this package.
In my situation, after bundling, the bundled file is the top level module and import-fresh and the packages it depends on are also in that same file. The call to parent-module then returns undefined because the call stack only consists of the file itself. The next call to resolve-from on the other hand expects the filePath to be a string and throws. I think falling back to the moduleId-path or __filename should be done instead.
I can reproduce this if I place the code of import-fresh in the same file and invoke it like this:
constpath=require('path');constresolveFrom=require('resolve-from');constparentModule=require('parent-module');// code of import-fresh ...functiona(){b();}functionb(){c();}// repeat until....functionh(){importFresh('./doesnt-matter');}a();
Reproduced on Windows 10 with node v14.5.0
I'm still not sure if I'm doing something wrong elsewhere because your package is used by so many other packages and noone has opened this issue yet.
The text was updated successfully, but these errors were encountered:
I have the situation where after bundling with Rollup I get an error when trying to resolve a config file through cosmiconfig and traced the error back to this package.
In my situation, after bundling, the bundled file is the top level module and
import-fresh
and the packages it depends on are also in that same file. The call to parent-module then returns undefined because the call stack only consists of the file itself. The next call to resolve-from on the other hand expects the filePath to be a string and throws. I think falling back to the moduleId-path or__filename
should be done instead.I can reproduce this if I place the code of
import-fresh
in the same file and invoke it like this:Reproduced on Windows 10 with node v14.5.0
I'm still not sure if I'm doing something wrong elsewhere because your package is used by so many other packages and noone has opened this issue yet.
The text was updated successfully, but these errors were encountered: