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

Uncaught TypeError: Cannot read properties of undefined (reading 'currentRoute') #1925

Open
KermanX opened this issue Nov 1, 2024 Discussed in #1924 · 1 comment
Open
Labels
bug Something isn't working needs investigation

Comments

@KermanX
Copy link
Member

KermanX commented Nov 1, 2024

Discussed in #1924

Originally posted by tschaub November 1, 2024
This would be better suited for a bug report, but I haven't yet figured out the minimum steps to reproduce the issue.

After running the Slidev dev server for a while, I often see these two warnings and the following error:

runtime-core.esm-bundler.js:51 [Vue warn]: injection "Symbol(router)" not found.

runtime-core.esm-bundler.js:51 [Vue warn]: Unhandled error during execution of setup function 
  at <App>

useNav.ts:276 Uncaught TypeError: Cannot read properties of undefined (reading 'currentRoute')
    at ComputedRefImpl.fn (useNav.ts:276:46)
    at refreshComputed (reactivity.esm-bundler.js:377:28)
    at get value (reactivity.esm-bundler.js:1627:5)
    at ComputedRefImpl.fn (useNav.ts:285:49)
    at refreshComputed (reactivity.esm-bundler.js:377:28)
    at get value (reactivity.esm-bundler.js:1627:5)
    at unref (reactivity.esm-bundler.js:1472:29)
    at toValue (index.mjs:211:42)
    at index.mjs:26:42
    at Array.some (<anonymous>)

This sometimes happens after adding or removing slides from slides.md. Other times it happens upon first starting the dev server after installing a package.

I'm using @slidev/[email protected] and [email protected].

I don't have any special router setup, I'm using the default theme, and am not calling useRouter myself. Has anyone else run into this?
Has anyone else run into this?

@KermanX KermanX added bug Something isn't working needs investigation before v1 labels Nov 1, 2024
@antfu
Copy link
Member

antfu commented Nov 18, 2024

I have that often in https://github.com/antfu/talks, but usually only the initial load, and it will go away when I do a browser hard refresh. I also can't reproduce it when moving out.

@KermanX KermanX removed the before v1 label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants