Open sxflynn opened 2 months ago
Update:
In my tsconfig.json
file I manually pointed to the aa-js directory in node_modules and this resolved the error.
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"aa-js": ["node_modules/aa-js/dist/index.d.ts"]
},
// rest of options
}
}
That being said, this should not be necessary. The package.json in the aa-js package needs to be modified so that it can point to types without the consumer modifying their local configuration.
Thank you very much for your bug report. I must admit I always had a very hard time understanding how to configure TS! Seriously, I read many articles, and the official documentation, but I always got lost.
I totally agree with your conclusion: this should not be necessary. However, I have no idea how to solve it.
I performed an
npm install aa-js
into my Typescript project and VS Code is giving this linting error on the import statement.I followed the example in the readme and started by importing julian days.
Under the 'aa-js' it provides an error and this is the message:
Could not find a declaration file for module 'aa-js'. '/[appname]/node_modules/aa-js/dist/aa-js.js' implicitly has an 'any' type. There are types at '[appname]/node_modules/aa-js/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'aa-js' library may need to update its package.json or typings. ts(7016)
For example, this code does work:
Although I am able to compile and run the web application with this error, I am not provided with any Typescript intellisense or typechecking.