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

When I use astro-diagram to render the mermaid sequence diagram, in developer mode, an error is reported! #9856

Closed
1 task done
iamyunsin opened this issue Jan 29, 2024 · 0 comments · Fixed by #9857
Closed
1 task done
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: toolbar Related to dev toolbar (scope)

Comments

@iamyunsin
Copy link
Contributor

Astro Info

> [email protected] dev /Users/bullub/个人中心/项目/blog
> astro dev

Debugger attached.

 astro  v4.2.6 ready in 1375 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

11:45:13 watching for file changes...
11:45:32 [200] /blog/hybrid/ios-wkwebview-ajax-lost/ 5438ms
11:45:32 [200] /blog/hybrid/ios-wkwebview-ajax-lost/ 3957ms
11:45:49 [ERROR] [toolbar] Failed to initialize dev toolbar app Audit (astro:audit):
TypeError: Cannot destructure property 'requiredProps' of 'roles.get(...)' as it is undefined.
    at Object.match (http://localhost:4321/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/astro/dist/runtime/client/dev-toolbar/apps/audit/a11y.js?v=956fd8b0:454:15)
    at lint (http://localhost:4321/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/astro/dist/runtime/client/dev-toolbar/apps/audit/index.js?v=956fd8b0:68:22)
    at async Object.init (http://localhost:4321/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/astro/dist/runtime/client/dev-toolbar/apps/audit/index.js?v=956fd8b0:28:5)
    at async AstroDevToolbar.initApp (http://localhost:4321/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/astro/dist/runtime/client/dev-toolbar/toolbar.js?v=956fd8b0:323:7)

If this issue only occurs in one browser, which browser is a problem?

Chrome

Describe the Bug

I found through breakpoint debugging that the issue is due to the role attribute of the SVG node rendered by mermaid being set to role="graphics document", resulting in const {required Props}=roles. get (role) in a11y.js; The code encountered an error during execution.

I understand that it may be necessary to parse the role attribute. If multiple roles are set, the value with index 0 will be prioritized.

What's the expected result?

Don't make an error.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ankjbg?file=package.json

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 29, 2024
iamyunsin pushed a commit to iamyunsin/astro that referenced this issue Jan 29, 2024
…. When multiple values are set in the role, only the first value is returned.

fix withastro#9856
iamyunsin added a commit to iamyunsin/astro that referenced this issue Jan 29, 2024
…. When multiple values are set in the role, only the first value is returned.

fix withastro#9856
@bluwy bluwy added - P3: minor bug An edge case that only affects very specific usage (priority) feat: toolbar Related to dev toolbar (scope) and removed needs triage Issue needs to be triaged labels Jan 29, 2024
iamyunsin added a commit to iamyunsin/astro that referenced this issue Jan 30, 2024
iamyunsin added a commit to iamyunsin/astro that referenced this issue Jan 30, 2024
iamyunsin added a commit to iamyunsin/astro that referenced this issue Jan 30, 2024
natemoo-re added a commit that referenced this issue Feb 13, 2024
* fix: Fixing the issue of errors caused by multiple values in the role, when multiple roles exist, check each role.

fix #9856

* Update .changeset/eight-flowers-remain.md

---------

Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: toolbar Related to dev toolbar (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants