TypeScript is unable to derive types from gl-matrix when a single type is imported using require('gl-matrix/vec3') or something similar:
Nevertheless, both require() statements are valid and equivalent as you can try in your REPL.
After filing an issue in the TypeScript repository, @RyanCavanaugh kindly explained to me that there must be a problem with the type definitions in this repository. As far as I understand, this repository would need to define all types that are exported in the src/index.js as default exports so that all entry points are declared correctly.
TypeScript is unable to derive types from
gl-matrix
when a single type is imported usingrequire('gl-matrix/vec3')
or something similar:Nevertheless, both
require()
statements are valid and equivalent as you can try in your REPL.After filing an issue in the TypeScript repository, @RyanCavanaugh kindly explained to me that there must be a problem with the type definitions in this repository. As far as I understand, this repository would need to define all types that are exported in the
src/index.js
as default exports so that all entry points are declared correctly.For the original issue, please see https://github.com/microsoft/TypeScript/issues/44077.