fern-api / fern

Input OpenAPI. Output SDKs and Docs.
https://buildwithfern.com
Apache License 2.0
2.68k stars 151 forks source link

[Bug] fern check does not validate mdx files #5081

Open joshknowles opened 2 weeks ago

joshknowles commented 2 weeks ago

Describe the Bug

Not sure if this is a bug or a feature request, but I'm porting a bunch of docs over from another tool and they contain markup that you don't support, such as <img> tags.

When working in local development I get the following error [docs]: Failed to read docs configuration. Rendering last successful configuration.

Two problems with this

  1. The problem isn't in the docs configuration, it's in being caused by a tag in specific .mdx file, so the error message could be more clear
  2. Running fern check does not report any errors. This is especially confusing when trying to debug an error in docs configuration

If an mdx page contains a markup tag that you don't support, such as a tag, then fern check works, but server returns

Information to Reproduce

Add an <img> tag to a mdx file and try and render the docs

CLI Version

0.44.11

Actual Behavior

If server is running, the docs do not render. Instead the above error is printed. If local server is not running, it won't start.

Expected Behavior

  1. I would expect fern check to catch this
  2. I would expect the error message to tell me what .mdx file it can't read
  3. I would love the ability to ignore the tags it can't parse and log them as warnings as opposed to errors
dannysheridan commented 2 weeks ago

Oof. Appreciate you calling out the two problems -- I agree with both.

To answer your question, I'd call #1 a feature request and #2 a bug. We'll likely split this into two issues when we tackle it.

joshknowles commented 2 weeks ago

Related to #5083. I think the reason the docs were originally failing was due to a self-closing <img> tag, not the fact that you don't support <img/> tags