N
Nuxt4w ago
FoxCode

How to handle large Markdown files in Nuxt Content 3?

I'm currently migrating my app from Nuxt Content 2 to Nuxt Content 3 and ran into a problem. I have a large Markdown file (about 13,000 lines) that contains the full documentation of my API (I can't split it - it needs to be one page so users can use CTRL+F, etc.) There was no issue with this file in Nuxt Content 2, but in Nuxt Content 3, when using better-sqlite3, the file simply doesn't work. In the console, I get these errors:
[unhandledRejection] near "AqVXMov94MXnIeqdox4wPbKzA6p3XzCoSV2agF4I7jI": syntax error
[unhandledRejection] unrecognized token: "\"
[unhandledRejection] near "AqVXMov94MXnIeqdox4wPbKzA6p3XzCoSV2agF4I7jI": syntax error
[unhandledRejection] unrecognized token: "\"
(where AqVXMov94MXnIeqdox4wPbKzA6p3XzCoSV2agF4I7jI is the hash of that md file). How can I fix this? ps. entire site is later generated with nuxt generate, so I don’t need SSR
4 Replies
kapa.ai
kapa.ai4w ago
Hi @FoxCode. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources provided do not contain specific information about handling large Markdown files in Nuxt Content 3 or the better-sqlite3 error you're encountering. The knowledge sources include general information about: - Using useAsyncData for fetching data with third-party SDKs in Nuxt 3 - Rendering Markdown content and partials in Nuxt Content - Accessing frontmatter properties - Various configuration and migration topics However, none of them address the specific issue of large Markdown files causing SQL syntax errors with better-sqlite3 in Nuxt Content 3, or provide solutions for this particular problem. For this specific issue, I would recommend: 1. Checking the official Nuxt Content 3 documentation or GitHub issues for known limitations with large files 2. Considering alternative storage drivers if better-sqlite3 has size limitations 3. Reaching out to the Nuxt Content community or filing an issue on their GitHub repository with the specific error details The knowledge sources do not contain enough information to provide a confident answer to your question about this specific technical issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4w ago
<@363971301947342848> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
FoxCode
FoxCodeOP4w ago
cc: @farnabaz
farnabaz
farnabaz4w ago
Hey @FoxCode There are some reports about better-sqlite3 and large data set. As workaround I suggest users to use Node's native sqlite adapter. Using native adapter solved the issue for users. Checkout https://content.nuxt.com/docs/getting-started/configuration#experimentalsqliteconnector I'm still digging about this issue. Also If your issue persists with native sqlite, could you provide a reproduction respository?

Did you find this page helpful?