Access to vue3 app.config.errorHandler? How do you handle client migration from to old to new assets (js/css) #4586
Unanswered
vladyslav2
asked this question in
Q&A
Replies: 1 comment 2 replies
-
// .vitepress/theme/index.ts
import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
// add app.config.errorHandler ...
}
} satisfies Theme vitepress handles this by default by the way. You might be doing some very custom stuff, or it might not be happening while routing 👀 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone.
Problem: So its possible that client will open website and while he reads and article update occur so he won't be able to fetch js/css files to move to new page. I.E. browser will complain:
Failed to fetch dynamically imported module
orwas blocked because of a disallowed MIME type
depends on cloudflare settings.Solution seems pretty simple - we need to refresh page so browser download new index.html file with correct links for js/css.
While solution seems simple, I haven't found a proper way to do this.
I've been looking for a way to update/extend vue3 error handler, but haven't found a way how to do this with vitepress
as a workaround solution I monkeypatch console.error method:
looks like a very very terrible solution but at least it works.
Any proposal how to make it better?
Beta Was this translation helpful? Give feedback.
All reactions