arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages

Home Page:https://arethetypeswrong.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Internal resolution error" issue for long file paths

inakiabt opened this issue · comments

While working on a project, attw CLI started to fail suddenly with an "Internal resolution error" when pushing a new component. The unique aspect of this new component is its relatively long name.

It's worth noting that I suspect this might not be an issue with attw itself but rather with TypeScript. I'm creating this issue to investigate, just in case my assumption is incorrect.

It appears that the failure is occurring here while trying to resolve imports within a specific source file.

Interestingly, I've noticed that if the file path length of the imported file exceeds approximately 82 characters (as far as I can tell), ts.getResolvedModule fails to resolve the import. This behavior doesn't make any sense, so I suspect there might be something off in my TypeScript configuration or elsewhere.

To assist with troubleshooting, I've created a repository to reproduce the issue:

https://github.com/inakiabt/ts-issue

My bet is this has something to do with the tar packing/unpacking. Have you tried running npm pack, then unpacking the tarball and seeing whether the file round trips properly?

Yep, you found a bug in my fork of untar.js, which was present in the repo I forked from, and also the repo that forked from. Fixed in the latest patch.