milesj / docusaurus-plugin-typedoc-api

Docusaurus plugin that provides source code API documentation powered by TypeDoc.
71 stars 25 forks source link

Docusaurus build (production) fails because of ParseError #120

Closed jpolo closed 11 months ago

jpolo commented 11 months ago

Extract of the error :

Error: Docusaurus server-side rendering could not render static page with path /api/core/namespace/Boolean because of error: Parse Error: <</a></li><li> ...

Context : "dependencies": { "@docusaurus/core": "3.0.0", "@docusaurus/module-type-aliases": "2.4.3", "@docusaurus/preset-classic": "3.0.0", "@mdx-js/react": "3.0.0", "clsx": "2.0.0", "docusaurus-plugin-typedoc-api": "4.0.0", "prism-react-renderer": "2.1.0", "react": "18.2.0", "react-dom": "18.2.0" }

Hint 1 : After some investigation, it seems to be provoked by an interface containing a method named "<". This method is declared using quotes so it is 100% valid TS / ECMA. I do not know implementation details of your plugin but it could be provoked by a missing html entities escaping.

Hint 2 : In dev mode, everything is fine.

milesj commented 11 months ago

@jpolo Can you paste the TS code snippet so I can test with it. I'm guessing it's just generics?

jpolo commented 11 months ago

https://github.com/w5s/std/blob/main/packages/core/src/boolean.ts is the file that triggered the error.

In this example, each file that extends Comparable will trigger the error.

milesj commented 11 months ago

Copied your code and it seems to work for me:

Screenshot 2023-11-04 at 11 40 40 AM

I'll force escape these values anyway to see if it fixes anything.