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

Cannot read properties of undefined (reading 'match') happens when an inline SVG includes <a> #1841

Closed
3 tasks done
sapphi-red opened this issue Jan 25, 2023 · 0 comments · Fixed by #1850
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@sapphi-red
Copy link
Contributor

Describe the bug

When an inline SVG includes <a>, the following error happens.

Uncaught TypeError: Cannot read properties of undefined (reading 'match')
    at app.2726314c.js:7:46422
    at NodeList.forEach (<anonymous>)
    at app.2726314c.js:7:46366

The error seems to be happening on this line.

const extMatch = pathname.match(/\.\w+$/)

Reproduction

https://stackblitz.com/edit/vite-wmvpvc?file=docs%2Findex.md

Expected behavior

No error happens.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    vitepress: latest => 1.0.0-alpha.40

Additional context

A real world reproduction: https://rollupjs.org/plugin-development/

I guess this bug doesn't affect any functionality other than prefetching.

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@sapphi-red sapphi-red added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 25, 2023
@brc-dd brc-dd added bug Something isn't working and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jan 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants