-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shiki highlighter not working for non-default languages causes 404 #983
Comments
Run into same issue. Decided to just drop syntax highlight Wasted already whole week trying to get company docs up and running again, coz of different Nuxt and Docus bugs :| |
I ended up switching to highlightjs. I tried following the markdown highlighter instructions but couldn't make it work, so I ended up modifying the default template to call <script lang="ts" setup>
import { onMounted } from 'vue';
import hljs from 'highlight.js'; // Import highlight.js if needed
onMounted(() => {
console.log("mounted")
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightBlock(block);
});
});
</script>
<template>
<DocsPageLayout>
<slot />
</DocsPageLayout>
</template>
<style>
.hljs {
width: 100%
}
</style> |
I got a similar issue, after upgrading docus theme to (v1.14.9) it fix the issue return
after upgrade, no more issue |
If I try to highlight a language other than the default like html or js, the site stops working and it can't be built. The browser shows a 404:
To attempt to debug this, I've started a docus project from scratch with
npx nuxi@latest init docs -t themes/docus
and added a snippet to the index pageThis is my nuxt.config.ts:
And this is the error I'm getting when
npm run dev
It seems that the error is related to grammar files, but I don't know how to fix it. I've tried downgrading to earlier shiki versions but that didn't fix it.
The text was updated successfully, but these errors were encountered: