-
I'm calling this in my vi.mock('@org/local-util/file.js');
import injectIframe from "./injectIframe";
...etc The path matches the imported file (imported in I tried moving that I can't find any way to debug this, there's no log of "attempted paths" that I can look at, it just fails to load and proceeds as if the How do I debug this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The solution was to start a node debugger in VS Code and wade my way through the code. There's no debugging/logging anywhere in that function. I ended up on the chunk: const dir = dirname(path);
const baseId = basename(path);
const fullPath = resolve(dir, "__mocks__", baseId);
return existsSync(fullPath) ? fullPath : null; Where I was able to determine that the expected path was not: dist/__mocks__/@org/local-util/file.js but dist/@org/local-util/__mocks__/file.js because the module was reported as not "external" |
Beta Was this translation helpful? Give feedback.
The solution was to start a node debugger in VS Code and wade my way through the code. There's no debugging/logging anywhere in that function. I ended up on the chunk:
Where I was able to determine that the expected path was not:
but
because the module was reported as not "external"