-
Notifications
You must be signed in to change notification settings - Fork 84
Unable to resolve directory dependencies #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe this is related to issue #118 |
hey! I notice in the output that you don't have a TSconfig defined. Is there a TS config option that would get this to work; if so, then you could supply the path to the TS config file and see if that works. If the file is pure commonjs, then it relies on the commonjs resolution algorithm (which handles the case you're mentioning). Since the "../src" module is going through TS proper: https://github.com/dependents/node-filing-cabinet/blob/master/index.js#L221, there might be a TS thing you need to set in a TS config. Let me know if that works at all. |
The following worked for me: const tree = dependencyTree.toList(
{
filename,
tsConfig: {
compilerOptions: {
allowSyntheticDefaultImports: true,
module: 'commonjs',
}
},
directory: './src',
nonExistent: non,
},
); |
Thanks for closing the loop @jeanlescure. If anyone wants to add docs to the readme to clarify this or help someone with a similar issue in the future, then I'd gladly review a PR. Cheers! |
I am unable to resolve the dependency if I'm importing a directory with an
index.ts
file.For example . . .
src/index.ts
tests/index.ts
Instead, what I have to do to make it work is explicitly import the index, which is less ideal.
src/index.ts
tests/index.ts
Here is the debug log for running the following command.
The text was updated successfully, but these errors were encountered: