mintlify / docs

🪴 Mintlify's documentation

Home Page:https://mintlify.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 500 on internal pages when hosted on Mintlify

kvyb opened this issue · comments

commented

Local mintlify dev renders pages fine.

Online, I am getting a 500 server error on the subpages: https://uitrial.mintlify.app/api-reference/example-usage. The issue persists for 24 hours now, and no reads or replies from Mintlify support team?

What's going on?

@kvyb hi where did you reach out? We'd love to help. Was it over email or the slack community..?

commented

@hahnbeelee it was over intercom on the 500 page.

commented

@hahnbeelee can I get an update on this please?

@kvyb the issue is that you have unescaped curly braces in api-reference/example-usage. If you attempt to navigate to this page using our CLI, you'll see:

ReferenceError: entity_id is not defined
    at _createMdxContent (eval at <anonymous> (/Users/rpmccarter/.mintlify/mint/client/.next/server/chunks/623.js:38233:35), <anonymous>:142:110)
    ...

This is because, in mdx, curly braces are used to invoke variables. Our mdx parser is attempting to replace {entity_id} with the value of the variable entity_id, but the variable does not exist. (We don't support variables at the moment.) To fix this, escape the curly brackets with a backslash:

make a GET request to /get\_question/\{entity_id\}, replacing \{entity_id\} with the ID
...
make a POST request to /process\_chunk/\{entity_id\}

Let me know if this works for you! Also, we have plans to block deployments that contain syntax errors in the future, since this should never get deployed in the first place. Stay tuned for that feature

commented

@rpmccarter thanks for the update. It's interesting that there are no errors or unusual behaviour when running it locally.

@kvyb the error in my response showed up when running locally - it should for you as well. Make sure your CLI is up-to-date with npm upgrade -g mintlify