Skip to content

error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class. #5043

Closed
@DerZyklop

Description

@DerZyklop

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/angular

SDK Version

6.19.7

Framework Version

6.19.7

Link to Sentry event

No response

Steps to Reproduce

Install TraceModule like this:

import * as Sentry from '@sentry/angular';


@NgModule({
	imports: [
		Sentry.TraceModule,
		
	],
	
	providers: [
		{
			provide: Sentry.TraceService,
			deps: [Router],
		},
		{
			provide: APP_INITIALIZER,
			useFactory: () => () => {},
			deps: [Sentry.TraceService],
			multi: true,
		},
	]
});
export class AppModule {}

Expected Result

No Error.

Actual Result

Error:

Error: node_modules/@sentry/angular/build/types/tracing.d.ts:51:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@sentry/angular) which declares TraceModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions