Skip to content

fix: stop returning when err so diagram can be rendered post error fix#1449

Open
ad1992 wants to merge 1 commit intomermaid-js:developfrom
ad1992:aakansha/err
Open

fix: stop returning when err so diagram can be rendered post error fix#1449
ad1992 wants to merge 1 commit intomermaid-js:developfrom
ad1992:aakansha/err

Conversation

@ad1992
Copy link
Copy Markdown

@ad1992 ad1992 commented May 14, 2024

📑 Summary

Currently in production if for any reason an error occurs, the diagram gets stuck and isn't rendered even after error is fixed hence I have fixed that in this PR

eg, try with below code and config in prod vs this PR

flowchart TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
{
"theme": "default",
"maxEdges": "10"

change the config to 2 and change it back to 10 -> In prod the diagrams will not rerender until refresh.

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

@netlify
Copy link
Copy Markdown

netlify bot commented May 14, 2024

Deploy Preview for mermaidjs ready!

Name Link
🔨 Latest commit 81d34c8
🔍 Latest deploy log https://app.netlify.com/sites/mermaidjs/deploys/664310b59efd0f00083c8dec
😎 Deploy Preview https://deploy-preview-1449--mermaidjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ad1992
Copy link
Copy Markdown
Author

ad1992 commented May 14, 2024

cc @sidharthv96

@ad1992
Copy link
Copy Markdown
Author

ad1992 commented May 18, 2024

friendly reminder @sidharthv96

Comment on lines 64 to 68
if (state.error !== undefined) {
error = true;
errorLines = state.error.toString().split('\n');
return;
}
error = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If return is removed, error is set as false immediately. So something else needs to be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants