Dagy
Dagy
NNuxt
Created by Dagy on 3/7/2025 in #❓・help
How To Cloudflare workers with Nuxt 3 ?
Hello community, I’m trying to deploy a nuxt site to cloudflare. I used the nuxt starter from the cli. But I haven’t been able to use the workers for the /server/api together with the hono library. I get internal server error. And not functionality for the server/api I haven’t this in my nuxt.config export default defineNuxtConfig({ compatibilityDate: "2024-11-01", devtools: { enabled: true }, nitro: { preset: "cloudflare-module", // ← Correct preset here }, modules: ["nitro-cloudflare-dev"], vite: { optimizeDeps: { include: ["hono"], }, }, }); I have this in my wrangler { "$schema": "node_modules/wrangler/config-schema.json", "name": "test-1", "compatibility_date": "2025-03-03", "compatibility_flags": ["nodejs_compat"], // ← Required "main": "./.output/server/index.mjs", "assets": { "binding": "ASSETS", "directory": "./.output/public/" }, "r2_buckets": [{ "binding": "BUCKET", "bucket_name": "your-bucket-name" }], "kv_namespaces": [{ "binding": "KV", "id": "your-kv-id" }], "d1_databases": [ { "binding": "DB", "database_name": "your-db-name", "database_id": "your-db-id" } ], "ai": { "binding": "AI" }, "observability": { "enabled": true } } This my workers code: // server/api/workers.js import { Hono } from "hono"; const app = new Hono(); app.get("/", (c) => { const name = c.req.query("name") || "World"; return c.json({ greeting: Hello, ${name}! }); }); export default app;
5 replies
NNuxt
Created by Dagy on 12/12/2022 in #❓・help
My Pinia Getters Lost Reactivity and can't figure out how to fix it.
it happens When state.Ciudad is updated by the user in the form, the getters valorPedido and valorDomicilio and valorDomicilio don't get updated. // The form
<FormKit
type="form"
:actions="false"
@submit="formData.pagar()"
#default="{ state: { valid } }"
>
<!-- Ciudad de entrega -->
<FormKit
type="select"
label="Ciudad de entrega"
name="Ciudad"
v-model="formData.Ciudad"
outer-class=""
required
:options="formData.ciudades"
/>
<p >Tu envio tiene un valor de {{'$'+(formData.valorDomicilio).toString()}} </p>
<!-- direccion de entrega-->
<FormKit type="submit" :disabled="!valid"
label="Pagar"
>
Ir a Pagar {{formData.valorPedidoConEnvioLetras}}
</FormKit>
</FormKit>
<FormKit
type="form"
:actions="false"
@submit="formData.pagar()"
#default="{ state: { valid } }"
>
<!-- Ciudad de entrega -->
<FormKit
type="select"
label="Ciudad de entrega"
name="Ciudad"
v-model="formData.Ciudad"
outer-class=""
required
:options="formData.ciudades"
/>
<p >Tu envio tiene un valor de {{'$'+(formData.valorDomicilio).toString()}} </p>
<!-- direccion de entrega-->
<FormKit type="submit" :disabled="!valid"
label="Pagar"
>
Ir a Pagar {{formData.valorPedidoConEnvioLetras}}
</FormKit>
</FormKit>
2 replies
NNuxt
Created by Dagy on 12/10/2022 in #❓・help
'textcss' is not a valid JavaScript MIME type
No description
1 replies