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.

API Docs Preview: x.slice is not a function

See original GitHub issue

Hello,

When I’d like to Preview Documentation, I show this error:

Something went wrong...
x.slice is not a function
Stack trace
TypeError: x.slice is not a function
    at Object.matchGrammar (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:26236)
    at Object.tokenize (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:26564)
    at Object.highlight (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:25251)
    at at (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:108:31856)
    at t.render (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:114:76644)
    at ji (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:62905)
    at Ai (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:62700)
    at Ri (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:66534)
    at Ha (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:90551)
    at Va (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:90935)

ReDoc Version: 2.0.0-rc.4 Commit: 0dab8af

There’s no Issues in the editor.

Thanks, Peter

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
paflovcommented, Apr 20, 2020

I had the same problem. Reproduction and workaround is easy:

This:

        "201":
          description:  OK, started
          content:
            text/plain:
              example: 1

causes the error, but this

        "201":
          description:  OK, started
          content:
            text/plain:
              example: "1"

works.

Redoc “2.0.0-rc.22”

0reactions
EricWittmanncommented, Jul 26, 2019

Just following up on this - @bpeterm can you supply a reproducer for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to solve ERROR TypeError: labels.slice is not a function?
But your labels is a Set object, which can't use slice . One way to fix this, would be to use an array...
Read more >
redoc-cli render TypeError: str.slice is not a function · Issue #870
The issue was with x-www-form-urlencoded . It was not encoded properly. Now it looks like bellow: image. Will land in the upcoming release....
Read more >
String.prototype.slice() - JavaScript - MDN Web Docs
slice () extracts the text from one string and returns a new string. Changes to the text in one string do not affect...
Read more >
JavaScript Array slice() Method - W3Schools
The slice() method returns selected elements in an array, as a new array. The slice() method selects from a given start, up to...
Read more >
Slice | API Reference | ArcGIS Maps SDK for JavaScript 4.25
The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the...
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