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

VersionBanner "cannot read properties of undefined" #124

Open
audionerd opened this issue Nov 29, 2023 · 0 comments
Open

VersionBanner "cannot read properties of undefined" #124

audionerd opened this issue Nov 29, 2023 · 0 comments

Comments

@audionerd
Copy link

audionerd commented Nov 29, 2023

I have the plugin configured for our project, but I'm getting this error from VersionBanner when I try to render any documentation page:

VersionBanner-bug

In our configuration, the latest and current docs are both at v5, whereas some Markdown docs are at v4. The API docs are per-package, with multiple packages, and none of them really need to be versioned (always showing API docs for only the latest version is probably fine).

The problem is this line:

const latestVersionInfo = docs[latestVersion.label];

Where latestVersion is

{name: 'current', label: 'XState v5', isLast: true, path: '/docs', mainDocId: 'about', …}

And docs is:

{
  4: {id: '/api', title: '4', description: '4'}
}

So docs['XState v5'] does not exist.

I'm using patch-package to bypass VersionBanner for now. Wondering if there's a simple fix for this I'm overlooking?

Project is here: statelyai/docs#288

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

1 participant