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

Cannot read property 'tokenizePlaceholders' of undefined #467

Closed
mheiland opened this issue Apr 23, 2018 · 9 comments
Closed

Cannot read property 'tokenizePlaceholders' of undefined #467

mheiland opened this issue Apr 23, 2018 · 9 comments

Comments

@mheiland
Copy link

I'm using redoc-cli 0.3.5 to build HTML pages from OpenAPI 2.0 specs. For one particular spec i'm experiencing trouble related to markdown parsing. The spec is public and the problem can be reproduced easily with node 8.11.1 and NPM 5.6.0.

The good people at markedjs did take a look and send me to you markedjs/marked#1234

$ wget https://documentation.open-xchange.com/components/facade/1.0.0/openapi.json
$ redoc-cli bundle openapi.json -o my-redoc.html --title hello world
[ReDoc Compatibility mode]: Converting OpenAPI 2.0 to OpenAPI 3.0
Prerendering docs
Cannot read property 'tokenizePlaceholders' of undefined
Please report this to https://github.com/markedjs/marked.
@ingoclaro
Copy link
Contributor

The same happens to me when using Redoc as a React component
It seems that one of the dependencies broke this since I saw this working before, but when I did a clean npm install it broke (with same version of Redoc).

@thom-nic
Copy link

thom-nic commented Apr 24, 2018

Also hit this, for me it's being triggered by a markdown code block( either 4-space indent or ```) inside a description field

Full backtrace:

   at /Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/prismjs/components/prism-php.js:121:40
    at Object.run (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/prismjs/prism.js:456:5)
    at Object.highlight (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/prismjs/prism.js:287:11)
    at highlight_highlight (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:296:42)
    at Object.highlight (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:3695:50)
    at Renderer.code (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/marked/lib/marked.js:796:28)
    at Parser.tok (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/marked/lib/marked.js:1058:28)
    at Parser.parse (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/marked/lib/marked.js:1003:17)
    at Function.Parser.parse (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/marked/lib/marked.js:985:17)
    at marked (/Users/thom/.nvm/versions/node/v8.9.3/lib/node_modules/redoc-cli/node_modules/marked/lib/marked.js:1322:1

versions:

± npm ls -g marked prismjs
/Users/thom/.nvm/versions/node/v8.9.3/lib
└─┬ redoc-cli@0.3.5
  └─┬ redoc@2.0.0-alpha.17
    ├── marked@0.3.19 
    └── prismjs@1.14.0 

@MAnyKey
Copy link

MAnyKey commented Apr 25, 2018

Installing prismjs@1.13.0 manually fixed the issue in my case.

@RomanHotsiy
Copy link
Member

Seems to be caused by PrismJS/prism#1400.
I will fix for the next alpha

OGKevin added a commit to bunq/doc that referenced this issue Apr 26, 2018
Manually installed prismjs at working version. (Redocly/redoc#467)
@doliveirakn
Copy link

+1

@PerfectPixel
Copy link

PerfectPixel commented May 18, 2018

This issue also affects the minified redoc.min.js that is shipped with redoc@1.22.0. redoc@1.21.2works fine.

@unional
Copy link

unional commented Aug 29, 2018

^ just hit with the same issue on 1.22 as @PerfectPixel

@monolithed
Copy link

monolithed commented Sep 3, 2018

@RomanGotsiy

Oops... ReDoc failed to render this spec
Cannot read property 'tokenizePlaceholders' of undefined

The same issue in redoc@1.22.0 when I use x-code-samples

      x-code-samples:
        - lang: 'JavaScript'
          source: new PetStore.v1.Pet();

@RomanHotsiy
Copy link
Member

Should be fixed in v1.22.2

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

9 participants