Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'shape') in nodes.ts #6014

Open
guilhem opened this issue Oct 31, 2024 · 2 comments
Open
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@guilhem
Copy link

guilhem commented Oct 31, 2024

Description

I encountered a TypeError: Cannot read properties of undefined (reading 'shape')

Steps to reproduce

  1. Use a node without a shape property.
  2. Call the insertNode function.

Screenshots

image
image

Code Sample

No response

Setup

  • Mermaid version: 11.4.0
  • Browser and Version: Chrome

Suggested Solutions

import { isValidShape } from './shapes.js';
//...
export async function insertNode(elem: SVGGroup, node: Node, renderOptions: ShapeRenderOptions) {
  if (!isValidShape(node.shape)) {
    throw new Error(`Invalid shape: ${node.shape}. Please check your syntax.`);
  }
  const shapeHandler = shapes[node.shape];
  //...
}

Additional Context

No response

@guilhem guilhem added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 31, 2024
@husainsaifuddin
Copy link

Can this bug be assigned to me?

@sidharthv96
Copy link
Member

Just to be clear, there's no need to wait for issues to be assigned before working on them. If you're interested in working on an issue, you can leave a comment so that others can see it. PRs are the way we usually link issues to contributors. So you can directly open a PR with the issue number in title/description, and GitHub will link those.

The reason why we don't assign issues is that it adds a lot of friction, waiting for someone to assign issues, work gets abandoned (life happens, and we're all doing it for free, so no issues with it), and others won't pick up the issue if it's already assigned. It's hard for maintainers to keep track of abandoned issues and unassign them, etc.

TLDR; There's no need to request issues to be assigned to you, just raise the PR directly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

3 participants