Pascal Martineau
Pascal Martineau
NNuxt
Created by Pascal Martineau on 2/26/2024 in #❓・help
The CJS build of Vite's Node API is deprecated.
I've been using vite-plugin-graphql-codegen with Nuxt for quite some time and I started getting this warning lately. My nuxt.config.ts looks like this:
import codegen from "vite-plugin-graphql-codegen";

export default defineNuxtConfig({
vite: { plugins: [codegen()] },
});
import codegen from "vite-plugin-graphql-codegen";

export default defineNuxtConfig({
vite: { plugins: [codegen()] },
});
The plugin itself seems to have the proper "type" / "exports" in package.json. Any help or guidance would be greatly appreciated !
1 replies
NNuxt
Created by Pascal Martineau on 2/20/2023 in #❓・help
Hybrid rendering on Vercel and dynamic cart data from cookie
I'm trying to configure hybrid rendering on Vercel for a headless Shopify e-commerce site and I'm having trouble getting the cart item count to display correctly on pre-rendered pages. The cart data comes from a composable that executes const cart = useState('cart', () => cartCookie.value || cartDefault). I tried wrapping the cart icon component inside <ClientOnly> but the cart item count is always stale when the cache is hit. Is the only / best solution to initialize the cart state inside onMounted or am I missing something obvious ?
1 replies