question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'call' of undefined

See original GitHub issue

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: Chrome
  • Version: 85.0.4183.121
  • Method of installation: Docker
  • Swagger-UI version: 3.35.0
  • Swagger/OpenAPI version: 3.0.1

Content & configuration

Example Swagger/OpenAPI definition:

Swagger-UI configuration options: Below copied from html here. Configured via Docker environment variables like here (URLS variable is different on live site than this link as can be seen in snippet below).

The only configuration options I am using are URLS and URLS_PRIMARY_NAME which can be verified as correct in the snippet below copied from the live site.

SwaggerUI({
        url: "https://petstore.swagger.io/v2/swagger.json",
        "dom_id": "#swagger-ui",
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout",
        urls: "[ { url: \"https://filterlists.com/api/directory/v1/swagger.json\", name: \"Directory\" } ]",
        "urls.primaryName": "Directory",
})

Describe the bug you’re encountering

The UI throws errors in the console and is unable to display the UI for my spec.

swagger-ui-bundle.js:1 TypeError: Cannot read property 'call' of undefined
    at n.value (swagger-ui-standalone-preset.js:1)
    at n.I.t.render (swagger-ui-bundle.js:1)
    at u._renderValidatedComponentWithoutOwnerOrContext (swagger-ui-bundle.js:1)
    at u._renderValidatedComponent (swagger-ui-bundle.js:1)
    at u.performInitialMount (swagger-ui-bundle.js:1)
    at u.mountComponent (swagger-ui-bundle.js:1)
    at Object.mountComponent (swagger-ui-bundle.js:1)
    at u.performInitialMount (swagger-ui-bundle.js:1)
    at u.mountComponent (swagger-ui-bundle.js:1)
    at Object.mountComponent (swagger-ui-bundle.js:1)
swagger-ui-standalone-preset.js:1 Uncaught TypeError: Cannot read property 'call' of undefined
    at n.value (swagger-ui-standalone-preset.js:1)
    at e.notifyAll (swagger-ui-bundle.js:1)
    at p.close (swagger-ui-bundle.js:1)
    at p.closeAll (swagger-ui-bundle.js:1)
    at perform (swagger-ui-bundle.js:1)
    at A (swagger-ui-bundle.js:1)
    at c.perform (swagger-ui-bundle.js:1)
    at Object.batchedUpdates (swagger-ui-bundle.js:1)
    at Object.batchedUpdates (swagger-ui-bundle.js:1)
    at Object._renderNewRootComponent (swagger-ui-bundle.js:1)

window.versions.swaggerUi
window.versions.swaggerUi
{version: "3.35.0", gitRevision: "g3a9179c", gitDirty: true, buildTimestamp: "Thu, 01 Oct 2020 18:13:52 GMT", machine: "ip-172-31-21-173"}

To reproduce…

Steps to reproduce the behavior:

  1. Go to https://filterlists.com/api/
  2. See that the Swagger UI does not load.

Expected behavior

The Swagger UI loads the default swagger.json from here.

Screenshots

image

Here it is working locally, albeit with a slightly different URLS and docker networking configuration for the dev environment. image

Additional context or thoughts

It seems to load fine locally, which tells me this could very well be a configuration error on my part. However, the errors are not giving me much to go off of on what to fix if so. One idea is maybe some kind of CORS issue since I only see this on my production site and not locally? I’m not sure.

Here is my docker compose that pulls the swagger-ui image.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mathis-mcommented, Oct 3, 2020

@collinbarrett Please try this: URLS="[ { url: 'http://localhost:8080/api/directory/v1/swagger.json', name: 'Directory'}]".

1reaction
mathis-mcommented, Oct 3, 2020

@collinbarrett actually I think the documentation is right. The examples can be used for docker env interface (-e Flag).

I will add an new example for docker-compose .env configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'call' of undefined ...
One of the solution was to use concatenateModules: false apparently, but to no avail, it didn't solve my issue. So I tried with...
Read more >
Uncaught TypeError: Cannot read property 'call' of undefined
I'm having an issue with webpack where if I stop watching and restart, it will build just fine, but if I edit a...
Read more >
Uncaught TypeError: Cannot read property 'call' of ... - Laracasts
You need to show us your code that is causing the error. It's pointing to my vue component, I excluded it from app....
Read more >
Cannot read property 'call' of undefined" error occurs when an ...
HtmlEditor - The " __webpack_require__ => Uncaught TypeError: Cannot read property 'call' of undefined" error occurs when an application with ...
Read more >
error in console TypeError: Cannot read property 'call' of ...
TypeError : Cannot read property 'call' of undefined - the code is. the file linked to the message is a theme bundle file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found