Skip to content

Class TraceDirective is neither an Angular component nor directive nor pipe #3282

Description

@SDohle

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node(raven for node)
  • @sentry/angular

Version:

6.2.0

Description

Hi,
I try to use the TraceDirectives in an Angular 9 project. (just a blank project created with angular-cli)
If I declare the TraceDirective like suggested in the manual:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {Router} from '@angular/router';
import * as Sentry from '@sentry/angular';
@NgModule({
declarations: [Sentry.TraceDirective],
imports: [
BrowserModule,
AppRoutingModule
],
providers: [
{
provide: Sentry.TraceService,
deps: [Router],
},
],
bootstrap: [AppComponent]
})
export class AppModule { }

The Angular compiler complains:

Class TraceDirective is neither an Angular component nor directive nor pipe

That is something I would expect here because usually I would just import the module (exported @NgModule) instead of declaring a directive/component/pipe from a external module again in my own module.

Are Angular applications > 9 not supported by this module?

Thanks & best regards
Steffen

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions