awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
924 stars 399 forks source link

Error while loading .md content #538

Closed david-mds closed 2 years ago

david-mds commented 2 years ago

I’m getting an error while parsing the .md content into html on get-fragments.jsx line 42:

const html = marked(parsedMarkdown.body, {
      headerPrefix: 'header-',
      silent: true
    })

Here’s what I’m seeing in browser console:

Uncaught (in promise) TypeError: A(...) is not a function
    at get-fragments.jsx:42:18

I built the project following the steps in https://github.com/awslabs/aws-api-gateway-developer-portal/blob/master/BUILDING.md and using my own dev-portal/deployer.config.js file based on dev-portal/example-dev-deployer.config.js. I got no errors during deployment except this html rendering issue. 

I also compared the version on GitHub with the sample one available here: https://developer.exampleapigateway.com/ and I see there is no get-fragments.jsx file in https://developer.exampleapigateway.com/, it has been replaced by get-fragments.js and the code in this file is different than the one available in get-fragments.jsx file from GitHub.

david-mds commented 2 years ago

I just fixed it replacing: import marked from 'marked' by import { marked } from 'marked' in get-fragments.jsx