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

Error: e.map is not a function #1723

Open
dstansby opened this issue Feb 17, 2024 · 2 comments
Open

Error: e.map is not a function #1723

dstansby opened this issue Feb 17, 2024 · 2 comments

Comments

@dstansby
Copy link
Contributor

I'm trying to get an up to date version of pydata-sphinx-theme working with Matplotlib (matplotlib/matplotlib#27658). With the current main branch of pydata-sphinx-theme search/theme changing/version switching isn't working, and I think this is because of the javascript error we're getting,

Uncaught (in promise) TypeError: e.map is not a function
    g https://output.circle-artifacts.com/output/job/65bed756-88de-4a26-93f0-3d06e9d8950f/artifacts/0/doc/build/html/_static/scripts/pydata-sphinx-theme.js?digest=2f715a4ca1682955a1c0:1
    937 https://output.circle-artifacts.com/output/job/65bed756-88de-4a26-93f0-3d06e9d8950f/artifacts/0/doc/build/html/_static/scripts/pydata-sphinx-theme.js?digest=2f715a4ca1682955a1c0:1
[pydata-sphinx-theme.js:1:4657](https://output.circle-artifacts.com/output/job/65bed756-88de-4a26-93f0-3d06e9d8950f/artifacts/0/doc/build/html/_static/scripts/pydata-sphinx-theme.js?digest=2f715a4ca1682955a1c0)

The code that is triggering this is

const n=(e=e.map((e=>(e.match=e.version==DOCUMENTATION_OPTIONS.theme_switcher_version_match,e.preferred=e.preferred||!1,"name"in e||(e.name=e.version),e)))).map((e=>e.preferred&&e.match)).some(Boolean)

It looks like this is some minified(???) javascript, so I'm not sure how to proceed with debugging. Any pointers welcome (is there a way to turn off the squashing of all the javascript into one line?)

A doc build that has this error is here: https://output.circle-artifacts.com/output/job/65bed756-88de-4a26-93f0-3d06e9d8950f/artifacts/0/doc/build/html/index.html

@drammock
Copy link
Collaborator

Looks like here:

https://github.com/pydata/pydata-sphinx-theme/blob/99f9b1c29854ee0f88884e032acc1997dfae370e/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js#L386-399

I'm away for the next week or so, so can't be of much help right away, but maybe seeing the unminified version will be enough for you to figure it out without me 🤞

@QuLogic
Copy link
Contributor

QuLogic commented Feb 21, 2024

This is because the version switcher appears to be trying to load https://output.circle-artifacts.com/_static/switcher.json which is obviously going to not work. Has the option for the version switcher URL changed?

There's an if (data) { around the caller to populateVersionSwitcher, but it appears that's not a sufficient condition?

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

3 participants