Closed nickzelei closed 7 years ago
Seems like there might be a bug in typings
when resolving a relative link?
Hmm. I checked and I can't find where that file is being referenced anywhere. In fact, the path referenced does not exist.
And typings is able to successfully build the project when running
typings bundle -o test/bundle.d.ts
typings
appears to think that the reference to ~ldapjs/lib/server
should be resolved to lib/server/index
, so it must think server is a folder, when it is in fact a module.
I think it's worse that that, it searches for server.d.ts
and falls back to server/index.d.ts
to support the node.js-like use-cases. However, the issue appears to be the ..
relative paths aren't going up a directory. It's odd, because I'm sure I have other libraries using this pattern - something must be off somewhere.
That's the same conclusion I arrived to as well. It's unable to go up a level. However, these type definitions are doing that in plenty of other places, which makes this error even more bizarre.
Enabling debug, I see it landing in https://raw.githubusercontent.com/types/npm-ldapjs/4f8b8a7be5d422b5bed8ac9b4b5b74f8ce4e5064/lib/messages//message.d.ts
(notice the two slashes, which is why it's messing up going up the directory). Not sure where those extra slashes are from yet.
The long term fix might be for typings
to normalize these paths beforehand so we don't end up in this case.
Ahhh good catch.
With my limited knowledge of typings
, it appears that it already accounts for this in some cases as during the bundle process it's able to resolve ..//result
to ~ldapjs/lib/messages/result
.
Regardless, thank you for tracking that down. I've submitted another PR upstream to fix the import.
Typings URL: https://github.com/types/npm-ldapjs
Questions (for new typings):
index.js
<->index.d.ts
)?Change Summary (for existing typings):