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

Unable to get property 'map' of undefined or null reference #1371

Closed
Servus7 opened this issue Jun 20, 2017 · 6 comments
Closed

Unable to get property 'map' of undefined or null reference #1371

Servus7 opened this issue Jun 20, 2017 · 6 comments
Assignees
Labels

Comments

@Servus7
Copy link

Servus7 commented Jun 20, 2017

This error occures when clicking any element in Microsoft Edge 40.15063.0.0.

@webron
Copy link
Contributor

webron commented Jun 20, 2017

Using which version of swagger-editor? What do you mean by 'clicking any element'?

@Servus7
Copy link
Author

Servus7 commented Jun 22, 2017

  1. I'm using the web version.
  2. Every button or dropdown in the toolbar or the sidepanel.

@webron
Copy link
Contributor

webron commented Jun 22, 2017

Thanks. I was able to reproduce the issue as well.

@ponelat
Copy link
Member

ponelat commented Jun 23, 2017

This is somehow related to swagger-js and in particular Edge's native fetch. We're getting undefined from the res.body in topbar.jsx, and its causing this.state.servers.map to fail.

JakeChampion/fetch#407 (comment) is a possible workaround.

@shockey
Copy link
Contributor

shockey commented Jun 23, 2017

Yeah, so this is an Edge bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9370062/

Looks like a fix is on the way as of Monday:

Jun 19, 2017: Changed Status from “Fixed” to “Fixed, not yet flighted”

I'm not too keen on adding code to our repository in order to fix a browser-specific bug that will be patched soon.

You can work around this by removing Edge's native fetch implementation before loading the Swagger-UI bundle on a page, so our fetch polyfill will take over:

  <script>
    if(window.navigator.userAgent.indexOf("Edge") > -1) {
      console.log("Removing native Edge fetch implementation")
      window.fetch = undefined
    }
  </script>

@Servus7, I know you're using the web version, so setting up a custom version of Swagger-Editor might be asking much of you. If that's the case, please ping me here and I'll set up a one-off deployment of Swagger-Editor with the workaround.

edit: accidentally said Swagger-UI instead of Swagger-Editor

@shockey
Copy link
Contributor

shockey commented Jun 23, 2017

Closing as wont-fix.

Thanks for reporting this, @Servus7!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants