BEST
DEALS
OF THE
YEAR!
SAVE UP TO $3,000
24 NOV
1 DEC
00 Days
00 Hrs
00 Min
00 Sec
Open Closed

After Upgrading to Abp Commercial V5.2, ChartjsStyleContributor is not recognized #2923


User avatar
0
piseth created
  • ABP Framework version: v5.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

5 Answer(s)
  • User Avatar
    0
    piseth created

    Within my lower version < 5.2, ChartjsStyleContributor is recognized and working fine. it is from Volo.Abp.AspNetCore.Mvc.UI.Packages.ChartJs.ChartjsStyleContributor I use it in my class MyChartViewComponent.cs under MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget

    ****Now it is not recognized

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
        StyleTypes = new[] { typeof(ChartjsStyleContributor) },
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    [DependsOn(typeof(ChartjsScriptContributor))]
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
  • User Avatar
    0
    piseth created

    any update plz?

  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    HI,

    We have upgrade Chartjs to version 3.7.0, no longer needs style.

    See: https://github.com/abpframework/abp/pull/11861

  • User Avatar
    0
    piseth created

    https://github.com/abpframework/abp/pull/11861

    So how my code should look like?

    it works like the following?

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
      
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Just remove ChartjsStyleContributor, it should be work.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 20, 2025, 09:12
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.