You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It appears that @types/node has reference imports that are absolute instead of relative, this means they are thought of as separate packages, and a separate import is attempted for a package that doesn't exist.
Not sure if other packages do this, maybe we can treat absolute with the .d.ts extension as a root import, or other smarts are required.
I resolved the issue myself by extending the sourceResolver and adding:
letuResolved=awaitsuper.resolveSourceFile(packageName,version,path);if(packageName==="@types/node"){// Fix up the reference imports, they seem to be broken// Since they are absoluteuResolved=uResolved?.replaceAll(/referencepath="/g,'reference path="./');}returnuResolved;
Describe the bug
It appears that @types/node has reference imports that are absolute instead of relative, this means they are thought of as separate packages, and a separate import is attempted for a package that doesn't exist.
Not sure if other packages do this, maybe we can treat absolute with the .d.ts extension as a root import, or other smarts are required.
I resolved the issue myself by extending the sourceResolver and adding:
See declaration: https://unpkg.com/@types/[email protected]/index.d.ts
To Reproduce
Import
@types/node
via versions object, and check our the console/network tab.Expected behavior
Imports the file correctly.
Screenshots
If applicable, add screenshots to help explain your problem. You can drag image files here to upload them to the issue.
Environment (please complete the following information):
monaco-editor-auto-typings
Version: 0.4.3Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: