-
Notifications
You must be signed in to change notification settings - Fork 0
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
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. #1
Comments
This issue probably happens because the plugin is not updated with the latest skott version yet. The latest plugin version is using |
Just released the |
Same problems. Runs forever and never finishes unless I delete the Docusaurus folder, and even when I do, it errors out in the same way. |
Alright, thanks for the information and btw thanks for reporting the issue @kaiyoma. Looking at the stack trace it seems to be related to TypeScript path aliases, can you please paste me some of the About Docusaurus I'm not really familiar with it, the current limitations with skott is that it does parse all the JS/TS files without taking into account tsconfig Could you also please try to run |
Our path aliases in our root tsconfig are pretty normal I think (slightly redacted):
Yes, this I see the same error and stack trace if I run |
Yes, they are. I'm not seeking for a misconfiguration on your side but rather a specific pattern that would not be supported yet. From what I tested in a little repro using that config, I wasn't able to reproduce that error. Might be somewhere else.
Cool, there is an on-going issue that will discard entries listed .gitignore files, so it won't be problematic anymore.
"include" is unfortunately not supported in skott as the initial goal was to be able to "crawl" everything that could be parsed (js/ts) by being config-less by default and emit graphs including potentially independent set of files or even independent set of projects (in the context of a monorepo). Consequently as of now, skott might traverse files that you don't expect to be analyzed as it will ignore the
Well, that's annoying. I'm kind of frustrated of not being able to help fixing that issue right away tbh. Would you mind sharing the following information please:
Thanks |
|
Another issue: even after skott exits, some Node process keeps running in the background and chewing up a ton of CPU until I kill it from the task manager. Seems kind of related to the other problems I'm seeing. |
Hello @kaiyoma, Thanks for the information. Using the latest stack trace, I was able to check what piece of code was throwing that error, but I'm not able to understand why this happens using the configuration you just provided me. Here is a reproduction of the setup using the tsconfig mentioned above using StackBlitz and when running I'm planning to implement a verbose mode to log everything happening under the hood. Having a bit of context + few operations before the crash will help me for sure determine the root cause hence implementing a fix. Meanwhile what I can do is implementing blindly a unexpected error handler at the precise location according to the stack trace. It won't fix the problem, it will just ignore the module declaration that is involved in that error and end the traversal for it hence the graph might miss some of the sub-project internal nodes but in the context of Rush.js you should not care much as internal nodes are only used to determine third-party and built-in dependencies that are used within a project (using the The only ones that are important for now are the workspace module declarations of the monorepo (and that should be working fine), not the TypeScript path aliases. These dependencies are tracked using the RushDependencyResolver. Indeed what I could even do faster than that is providing a flag to disable the EcmaScriptDependencyResolver and only use the RushDependencyResolver allowing you to build the Rush monorepo graph. As I said it won't provide you whole the metadata that's found by the EcmaScriptDependencyResolver (third-party modules, built-in modules) but maybe you don't even care about that. TL;DR:
|
Our repo is quite large and complicated, and actually includes both monorepo and non-monorepo elements, so I'm not surprised that you can't repro this problem easily on your side. I think adding verbose logging would be the best path forward here and I'm happy to gather those logs for you and report back. Another interesting data point: the stack trace appears to be happening only on Windows. |
I'll do that as a priority for sure. Next week I'm off, so won't be able to do it until I'm back.
Thanks for offering that help, it's still the early days for the skott ecosystem and there is a lot to do so I truly appreciate that you're taking the time to report the issue and help me improving the whole thing.
That's indeed an interesting input! The For the cases where Putting aside the very experimental status of this plugin hence the bugs and the very limited API as of now, I'd be happy to hear your suggestions/things that would be valuable from your experience that could be implemented in the future. I already had some feedback from the Rush core team and I already have many things to do in my internal backlog, I'll try to make them public in this repo. Consequently if you prefer to talk about suggestions feel free to do it wherever it's the more convenient for you (here, other issue on this repo, using the thread on the Rushstack issue...) |
I still can't get it to complete locally (I have a Windows 11 laptop), but my worker who has a MacBook seems pretty happy with the output! I've seen some screenshots from him and it looks like skott is correctly mapping out the dependency graph of all our packages. I'm hoping to incorporate this into our (Linux-based) CI so that we can generate and publish a new graph on every merge. It'll be really helpful - especially for newbies - to have a visual reference for the monorepo that's always up to date. |
@kaiyoma Alright thanks for the feedback! It's only the beginning and there is still a lot to do so if you have any use case in mind that could be valuable for you feel free to open another issue with the feature request :) |
Hey @kaiyoma hope you're doing well. Just published skott@0.22.0 including a "--verbose" flag that can be used to display a bunch of logs. Not everything is logged yet but it might be helpful to try it out. FYI I'll release soon a new version of the plugin that does exactly the same thing and expose the same flags so that we avoid passing by skott directly |
Here's the output after letting it run for a few seconds: skott.txt I see this error right away:
That path is not quite correct. Our tsconfig has been factored out to a package, and skott doesn't seem to be resolving that correctly. Our root tsconfig has this:
However, that is linked in our node_modules via pnpm's linking mechanism, like this:
Since this seems to be a Windows-only issue, maybe the backslashes in the path are also causing issues? |
Thanks for the quick feedback once again!
This is actually expected because skott does not handle external (non-relative) tsconfig "extends" yet, and I actually thought of supporting lately, that's why I created that issue few days ago 😄 This is actually pretty easy to solve, so it will be done very quickly. Nevertheless, this won't actually solve your problem while using the plugin for Rush.js as resolving Rush dependencies doesn't rely on the ECMAScript dependency resolver (in charge of resolving TypeScript path aliases) but on the Rush resolver embedded in the plugin (and that will be available soon to use without any other resolver)
Yeah it's probably a Windows specific problem, but backslashes should be fine because I'm using the cross platform Moreover I downloaded the file you shared containing the logs and from what I can see at the end of file the process keeps resolving modules without finishing, was the file truncated or did you exited the process manually to avoid the FYI I'm already very grateful for the time you're taking to precisely report the problem so I wanted to let you know that I'll stop any feature enhancement and make this problem resolution a priority by switching up fully to Windows as it's probably related to that somehow, it will be easier for me to reproduce that on my own. |
I ran it again and let it run to completion: skott-verbose.txt |
Moving the issue created by @kaiyoma here:
The text was updated successfully, but these errors were encountered: