isakwang
Explore posts from serversstoring bearer tokens on server
Hello
Im trying to use the Kinde management API but im a bit unsure about the best way to do so is. It is authenticated with Oauth2 and that returns a bearer token that can be used for some time. Should I request a new token each time, or is there a way to get a token once and use it until it expires?
Docs: https://kinde.com/api/docs/#kinde-management-api
1 replies
v-for where v-if only affects one element
Hello
Not sure how to google for this so asking here. I have a list of elements with an @click directive and a v-if that toggles some elements within the parent. Currently im using a single ref, but that means all off them expand when one is clicked instead of that one. How can I fix this
Example
<div v-for="item in list" @click="expand">
<h1>{{item.label}}</h1>
<p v-if="expand">{{ item.description }}</p>
</div>
4 replies
importing stripe in API
Hello
Im looking at how to integrate stripe into Nuxt and have to create a server route to deal with creating sessions. When importing the package im getting an error that they can´t find the package, but it is on npm. Any obvius solutions?
Error: [worker reload] [worker init] Cannot find package '@stripe/stripe-js'
import {loadStripe} from '@stripe/stripe-js';
export default defineEventHandler(async (event) => {
const stripe = await loadStripe(process.env.STRIPE_SECRET_KEY);
const session = await stripe.checkout.session.create({
success_url: '/response/success',
line_items: [
{
price: 'price_1PEZkcP1SGiKSfI8iw0DBc1q',
quantity: 3
},
],
mode: 'payment'
})
return session
})
Relevant docs
https://docs.stripe.com/api/checkout/sessions/create
https://docs.stripe.com/libraries/stripejs-esmodule#web-stripejs-esmodule
https://docs.stripe.com/checkout/quickstart1 replies
Cloudflare fail to publish
Hello
Im getting an error when deploying to github, but after googling and trying to find the error in my project im stumped. Has anyone else ran into this and fixed it?
It runs fine on both Nuxt dev and build/preview
Error below and buildlog attached
Error: Failed to publish your Function. Got error: Uncaught ReferenceError: global is not defined
at chunks/runtime.mjs:1:30871
8 replies
V-if not working
I have this set of if statements, but they aren't executing properly. I have tried both row.status and row.status.value but the former returns the value without the component and the latter returns the first statement even though the value is Completed.
What am i doing wrong?
<template #status-data="{ row }">
<UBadge
v-if="row.status == Pending"
color="yellow"
:label="row.status"
/>
<UBadge
v-else-if="row.status == Completed"
color="green"
:label="row.status"
/>
3 replies
Error using Nuxt sanity module
Hello. Getting an error when fetching data using the @nuxtjs/sanity module that I don't really get. It does fetch all the data so im not sure what goes wrong, but it does disappear when i remove the useSanityQuery composable. Any ideas?
/_nuxt/node_modules/.pnpm/[email protected]/node_modules/parse-headers/parse-headers.js?v=59aa2b87' does not provide an export named 'default'
2 replies
Page not found when using Kinde login
Hello
Trying out Kinde, but im having some issues when deploying it to cloudflare pages. The login works locally, but i get this when deploying
Error: Page not found: /api/login
. When looking at the buildlogs i can't see the api/login path among the other api either. Any ideas for what this can be?1 replies
Error after update
Getting this fault when trying to use nuxt supabase login. Could this be because of the error in 3.11?
Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.cache/vite/client/deps/ufo.js?v=5e84139c' does not provide an export named 'joinRelativeURL' (at paths.mjs:1:10)
2 replies
Error with node version on build
Hello
Im getting this weird error when trying to deploy to vercel about the wrong version of esbuild. Can't find any info on google either. As far as i can tell if references the node version in package.json, but there has never been a node version there before
[00:00:11.797] Running build in Washington, D.C., USA (East) – iad1
[00:00:11.905] Retrieving list of deployment files...
[00:00:12.362] Downloading 89 deployment files...
[00:00:15.778] Restored build cache
[00:00:15.848] Running "vercel build"
[00:00:16.357] Vercel CLI 33.5.4
[00:00:17.209] Installing dependencies...
[00:00:17.260] bun install v1.0.30 (1424a196)
[00:00:17.273] Resolving dependencies
[00:00:17.598] Resolved, downloaded and extracted [2]
[00:00:17.605] Saved lockfile
[00:00:18.776] /vercel/path0/node_modules/vite/node_modules/esbuild/install.js:133
[00:00:18.776] throw new Error(
Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)});
[00:00:18.776] ^
[00:00:18.777]
[00:00:18.777] Error: Expected "0.19.12" but got "0.20.1"
[00:00:18.777] at validateBinaryVersion (/vercel/path0/node_modules/vite/node_modules/esbuild/install.js:133:11)
[00:00:18.777] at /vercel/path0/node_modules/vite/node_modules/esbuild/install.js:286:5
[00:00:18.777]
[00:00:18.777] Node.js v20.11.1
[00:00:18.777]
[00:00:18.778] error: postinstall script from "esbuild" exited with 1
[00:00:18.799] Error: Command "bun install" exited with 1
[00:00:19.545]
1 replies