Closed anurag55555 closed 3 years ago
That is a general error for any library in a Typescript environment that does not come with a type declaration file. I haven't seen one for this library (just started trying it out today) so I had to add a generic module declaration in my app. This isn't strictly a loggly error, as you will see that message for any untyped-library. Loggly could fix it by providing a type declaration, but in the meantime you can bypass it either in your typescript configuration or adding a declared module, similar to:
declare module 'loggly-jslogger';
I put that in a types.d.ts then referenced it by adding the following line to the top of my index.tsx file:
/// <reference path="../types.d.ts" />
Hope that helps!
Thank you that solved my issue.
I have been trying to send my logs to Loggly using loggly-jslogger, but I am unable to do so. I installed the package using npm-- 'npm i loggly-jslogger'.
I created the logger as shown :
but the error due to very first line of the code states- "Could not find a declaration file for module 'loggly-jslogger'. '/home/Desktop/LOgginAttempt/node_modules/loggly-jslogger/index.js' implicitly has an 'any' type. Try
npm i --save-dev @types/loggly-jslogger
if it exists or add a new declaration (.d.ts) file containingdeclare module 'loggly-jslogger';
"can you please suggest as to why I am facing this issue?