Skip to content

fix(chart): missing BootstrapBlazor class#593

Merged
ArgoZhang merged 2 commits intoBootstrapBlazor:masterfrom
kimdiego2098:chart_dev
Oct 12, 2025
Merged

fix(chart): missing BootstrapBlazor class#593
ArgoZhang merged 2 commits intoBootstrapBlazor:masterfrom
kimdiego2098:chart_dev

Conversation

@kimdiego2098
Copy link
Copy Markdown
Contributor

@kimdiego2098 kimdiego2098 commented Oct 11, 2025

fix(chart):修复初始化时产生的未定义错误

Summary by Sourcery

Bug Fixes:

  • Ensure window.BootstrapBlazor is defined before using it to prevent undefined errors on chart initialization

close #594

Summary by Sourcery

Bug Fixes:

  • Define window.BootstrapBlazor if it is undefined to avoid errors during Chart initialization

@bb-auto
Copy link
Copy Markdown

bb-auto Bot commented Oct 11, 2025

Thanks for your PR, @kimdiego2098. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Oct 11, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduces a guard to ensure the global BootstrapBlazor namespace exists before accessing its Chart property, preventing undefined errors during chart initialization.

Flow diagram for BootstrapBlazor namespace initialization

flowchart TD
    A["Check if window.BootstrapBlazor is undefined"] -->|Yes| B["Initialize window.BootstrapBlazor as empty object"]
    A -->|No| C["Do nothing"]
    B --> D["Proceed to check window.BootstrapBlazor.Chart"]
    C --> D
    D -->|If undefined| E["Initialize window.BootstrapBlazor.Chart"]
    D -->|If defined| F["Do nothing"]
Loading

File-Level Changes

Change Details Files
Initialize window.BootstrapBlazor if undefined
  • Check if window.BootstrapBlazor is void 0
  • Assign window.BootstrapBlazor to an empty object when missing
Chart.razor.js

Assessment against linked issues

Issue Objective Addressed Explanation
#594 Define the missing BootstrapBlazor class (window.BootstrapBlazor) to prevent undefined errors during chart initialization.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot requested a review from ArgoZhang October 11, 2025 16:24
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@bb-auto bb-auto Bot added the bug Something isn't working label Oct 12, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Oct 12, 2025
@ArgoZhang ArgoZhang changed the title fix(chart):修复初始化时产生的未定义错误 fix(chart): missing BootstrapBlazor class Oct 12, 2025
@ArgoZhang
Copy link
Copy Markdown
Member

@sourcery-ai review

ArgoZhang
ArgoZhang previously approved these changes Oct 12, 2025
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Move the global BootstrapBlazor initialization to a shared bootstrap module instead of placing the guard in each component to keep the setup DRY.
  • For conciseness, consider using nullish coalescing assignment (window.BootstrapBlazor ??= {}) if your build targets support it.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Move the global BootstrapBlazor initialization to a shared bootstrap module instead of placing the guard in each component to keep the setup DRY.
- For conciseness, consider using nullish coalescing assignment (window.BootstrapBlazor ??= {}) if your build targets support it.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 28a8265 into BootstrapBlazor:master Oct 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Chart): missing BootstrapBlazor class

2 participants