question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find a declaration file for module '@elastic/apm-rum-angular'

See original GitHub issue
  1. Follow the steps from https://www.elastic.co/guide/en/apm/agent/rum-js/current/angular-integration.html
  2. Run ng serve
  3. Error: Could not find a declaration file for module '@elastic/apm-rum-angular'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
vitormsilvacommented, Oct 8, 2020

I added this to my project under the ./src/@types folder and then reference on the typeRoots inside of the tsconfig.json

// elastic__apm-rum-angular.d.ts
declare module '@elastic/apm-rum-angular' {
    import { Router } from '@angular/router';
    import { ErrorHandler } from '@angular/core';

    export interface Config {
        serviceName: string;
        serverUrl: string;
    }

    export class ApmService {
        router: Router;
        static apm: any;
        constructor(router: Router);
        init(config: Config): any;
        observe(): void;
    }

    export class ApmErrorHandler extends ErrorHandler {
        static apm: any;
        handleError(error: any): void;
    }
}
2reactions
mezzo1981commented, Oct 2, 2020

Any update on this? We get also this error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'module-name'. ...
In order for this to work, I had to make declare module '...' the first line of code in the module.d.ts file, and...
Read more >
Could not find declaration file for module 'X' Error
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >
elastic/apm-rum-angular
Start using @elastic/apm-rum-angular in your project by running `npm i ... indicating that this package has built-in type declarations.
Read more >
Has anyone been able to use @elastic/apm-rum-angular ...
ApmService could not be resolved because the types weren't exported. I had to create my own typings.d.ts file (which worked locally via ng...
Read more >
Error: Could not find a declaration file for module - YouTube
Fix error: Could not find a declaration file for module ... implicitly has an 'any' type.Try npm install library-name if it exists or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found