Skip to content

Uncaught (in promise) Error: pageData() is called without provider. #3197

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

Closed
1 task done
GentleGhostCoder opened this issue Jan 16, 2024 · 2 comments
Closed
1 task done

Comments

@GentleGhostCoder
Copy link

  • I confirm that this is an issue rather than a question.

Bug report

vue-router.mjs:3471 Error: pageData() is called without provider.
    at usePageData (chunk-DHNSDB55.js?v=057606df:30:11)
    at resolveArraySidebarItems (useSidebarItems.js?v=057606df:79:18)
    at resolveSidebarItems (useSidebarItems.js?v=057606df:44:16)
    at useSidebarItems.js?v=057606df:24:41
    at ReactiveEffect.fn (reactivity.esm-bundler.js:990:13)
    at ReactiveEffect.run (reactivity.esm-bundler.js:176:19)
    at get value [as value] (reactivity.esm-bundler.js:1000:61)
    at triggerComputed (reactivity.esm-bundler.js:195:19)
    at get dirty [as dirty] (reactivity.esm-bundler.js:148:11)
    at get value [as value] (reactivity.esm-bundler.js:999:41)
triggerError @ vue-router.mjs:3471
(anonymous) @ vue-router.mjs:3508
Promise.catch (async)
handleScroll @ vue-router.mjs:3508
finalizeNavigation @ vue-router.mjs:3354
(anonymous) @ vue-router.mjs:3218
Promise.then (async)
pushWithRedirect @ vue-router.mjs:3185
push @ vue-router.mjs:3110
navigate @ vue-router.mjs:2196
callWithErrorHandling @ runtime-core.esm-bundler.js:193
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:201
invoker @ runtime-dom.esm-bundler.js:671
Show 11 more frames

Steps to reproduce

After the steps from the guide have been completed (https://v2.vuepress.vuejs.org/guide/getting-started.html#manual-installation).

  1. Create 2 pages with some subheaders. E.g.:
# MainPage

## Subheader

This is a test page.

and

# OtherPage

## Subheader

This is a test page.
  1. Create a config.js as follows:
import {defaultTheme, defineUserConfig} from 'vuepress';

export default defineUserConfig({
		theme: defaultTheme({
					sidebar: [
						{
							text: "Page",
							link: "/"
						},
						{
							text: "Page1",
							link: "/page1",

						},
						{
							text: "Page2",
							link: "/page2",

						}
					],
		}),
})
  1. Run the vuepress in DEV (or build it and run with serve).
  • vuepress dev docs
  • vuepress build docs && npx serve docs/.vuepress/dist/
  1. After click a subheader in the sidebar the error occur.

What is expected?

I expect to change between the subheader in the sidebar without error.

What is actually happening?

After switching between the pages and click on a subheader i can switch the pages correctly anymore.

Click on subheader...
image

Switch to other... (still MainPage Sidebar is open).
image

@webYangFeng
Copy link

How did you solve it

@GentleGhostCoder
Copy link
Author

I use the "next" dependencies instead 2.0.0-rc.0. For some reason it fixed the problem. I also closed the ticket because the repo is only for vuepress v1 (as I understand it).

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

No branches or pull requests

2 participants