codeapp icon indicating copy to clipboard operation
codeapp copied to clipboard

TypeScript and JavaScript are unable to get definitions from imported files and node modules

Open 8Crafter opened this issue 1 year ago • 0 comments

when importing things from other files and/or node modules, it only gets the base definition of the property, but not any of the properties of the import. For example let's say that you imported the "@minecraft/server" module as the namespace mcServer with import * as mcServer from "@minecraft/server". Then, you start trying to reference it, the autocomplete does show the mcServer variable and defines it as import mcServer, however when you try to access one of its properties, there are no definitions, it basically treats it as the any type. Another example would be if you imported the server class from @minecraft/server, you would see the property in autocomplete, but when trying to access one of its properties (ex. system.run), they have no type definitions and the system class is treated like the any type. The same thing happens with other imported typescript files.

8Crafter avatar Nov 16 '24 07:11 8Crafter