brunomgmateus
brunomgmateus
NNuxt
Created by brunomgmateus on 9/18/2024 in #❓・help
Is it possible to exclude a component from a cached route?
In a project, I have routeRules like:
routeRules: {
'/*': {
cache: {
maxAge: 60,
staleMaxAge: 120,
},
},
},
routeRules: {
'/*': {
cache: {
maxAge: 60,
staleMaxAge: 120,
},
},
},
Pages get cached correctly, and inside some pages I use @nuxtjs/device to render different components if its mobile or not. If routeRules are not caching the page, @nuxtjs/device is able to SSR the correct component. However, as soon as the above rules are implemented, it starts warning about hydration errors, as the SSR is returning cached html that is no longer valid. Here's a reproduction of the issue. https://stackblitz.com/edit/nuxt-starter-ttceua?file=nuxt.config.ts (just comment the routeRules to observe the disappearance of hydration errors when the rules are disabled). Is there a way to exclude certain components from routeRules cache? I couldn't find a way to do so.
4 replies
NNuxt
Created by brunomgmateus on 3/22/2024 in #❓・help
Vue devtools 6.6.1 doesn't seem to work properly since Nuxt 3.10, and stopped displaying in 3.11
Hi everyone. I've been using Vue Devtools with Nuxt for years already, but it seems to be broken on the latest updates of Nuxt. The extension is detected correctly, but never displays the tab in Chrome Devtools (same behaviour in Firefox). Looking at the DOM, I can see
<div id="vue-inspector-container" data-v-app="">
<div data-v-31d1379f="" data-v-inspector-ignore="true">
<!--v-if-->
<!-- Overlay -->
<!--v-if-->
</div>
</div>
<div id="vue-inspector-container" data-v-app="">
<div data-v-31d1379f="" data-v-inspector-ignore="true">
<!--v-if-->
<!-- Overlay -->
<!--v-if-->
</div>
</div>
Still think this is likely a VueDevtools bug, but I've initialised various versions of Nuxt, and seems like it behaves differently across different versions. Also tried to use vue-devtools standalone, but also doesn't run, with an Uncaught Error: Dynamic require of "crypto" is not supported Anyone has any ideas about what could be the issue?
11 replies