Open FezVrasta opened 2 months ago
Name | Link |
---|---|
Latest commit | ff34dbc43a24652e464d2ef455fbb5cc17708f48 |
Latest deploy log | https://app.netlify.com/sites/mermaid-js/deploys/6613a7384536560008741b45 |
Deploy Preview | https://deploy-preview-5448--mermaid-js.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Unfortunately these changes are still not enough to avoid all the runtime errors related to missing DOM nodes. The fact .node()
can return void means every time it's used there should be a check.
@FezVrasta can you share which issue this PR is trying to solve? If there is no existing issue, can you share what the errors that you are facing are?
We are running mermaid on a React application, and we are encountering errors of the kind "cannot read getBBox from undefined".
Can you post an example mermaid code that has the issue?
I'm unable to provide a repro at this time, but the PR fixes at least 1 type error (where you are forgetting to call node
), I don't think a repro is required to fix type errors that can be verified by looking at the implementation of the method right?
I don't think a repro is required to fix type errors that can be verified by looking at the implementation of the method right?
No, it's not. The JS code does have code that sometimes feels like errors, but are infact guard clauses or workarounds to resolve other issues (it does have actual errors too :) ). There is an ongoing effort to migrate to TS, which has caught a lot of errors like this.
But in this case, the if condition was a guard clause, maybe to handle some unit test cases. So the proper fix would be to fix the test, and then remove the if (or call the .node()).
The following unit test failure is caused after calling the node.
And I requested the repro to find out what's happening at runtime.
:bookmark_tabs: Summary
Brief description about the content of your PR.
Resolves #
:straight_ruler: Design Decisions
Describe the way your implementation works or what design decisions you made if applicable.
:clipboard: Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch