admin管理员组文章数量:1288075
I am using Angular 19.0.0 and Prime NG 19.0.0, when I add button module on my imports array on my header standalone component I get this error : An unhandled exception occurred: fn is not a function See "C:\Users\GIANNI~1\AppData\Local\Temp\ng-AVgu2w\angular-errors.log" for further details.
Only if I remove ButtonModule from my component its working fine.
I try to import ButtonModule on my standalone component : imports: [ButtonModule],
This is my app.config.ts file where I set to use PrimeNG :
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideClientHydration(withEventReplay()),
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Aura,
},
}),
],
};
And bellow is my header component where I want to use the button. And by just import it to header ts file I get the error : TypeError: fn is not a function
import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
@Component({
selector: 'app-header',
imports: [ButtonModule],
templateUrl: './headerponent.html',
styleUrl: './headerponent.css',
})
export class HeaderComponent {}
I am using Angular 19.0.0 and Prime NG 19.0.0, when I add button module on my imports array on my header standalone component I get this error : An unhandled exception occurred: fn is not a function See "C:\Users\GIANNI~1\AppData\Local\Temp\ng-AVgu2w\angular-errors.log" for further details.
Only if I remove ButtonModule from my component its working fine.
I try to import ButtonModule on my standalone component : imports: [ButtonModule],
This is my app.config.ts file where I set to use PrimeNG :
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideClientHydration(withEventReplay()),
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Aura,
},
}),
],
};
And bellow is my header component where I want to use the button. And by just import it to header ts file I get the error : TypeError: fn is not a function
import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
@Component({
selector: 'app-header',
imports: [ButtonModule],
templateUrl: './headerponent.html',
styleUrl: './headerponent.css',
})
export class HeaderComponent {}
Share
Improve this question
asked Feb 22 at 16:14
Paris SakkoulasParis Sakkoulas
12 bronze badges
1 Answer
Reset to default 0I did some research and found that the issue was likely due to version conflicts. To resolve it, I uninstalled Angular and reinstalled it globally. Now, everything is working fine.
本文标签:
版权声明:本文标题:primeng - Error on adding Prime NG button module to my Angular 19 project (An unhandled exception occurred: fn is not a function 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741334986a2372990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论