llamaz
llamaz
Explore posts from servers
CDCloudflare Developers
Created by llamaz on 3/22/2025 in #pages-help
Remove CF-added headers with fetch
No description
1 replies
CDCloudflare Developers
Created by llamaz on 2/23/2025 in #workers-help
Disallowed operation called within global scope...
I'm trying to call an async API wrapper within a worker, but whenever I try to add the stats function, I get "isallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope". Unless I'm misinterpreting the documentation, is this not out of global scope (and inside a handler)?
import { verifyDiscordRequest } from './verifyDiscordRequest';
import Client from "mylib"

addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request: Request<unknown>, CfProperties<unknown> ) {

if (commandName === 'ping') {
} else if (commandName === 'stats') {
return await stats(interaction).then((data) => {
return new Response(JSON.stringify(data.base_info), {
headers: { 'Content-Type': 'application/json' },
});
});
}

function stats(interaction: any) {
return new Client({
loginOptions: {
},
}).getStats(interaction.data?.options[0]?.value);
}
}
import { verifyDiscordRequest } from './verifyDiscordRequest';
import Client from "mylib"

addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request: Request<unknown>, CfProperties<unknown> ) {

if (commandName === 'ping') {
} else if (commandName === 'stats') {
return await stats(interaction).then((data) => {
return new Response(JSON.stringify(data.base_info), {
headers: { 'Content-Type': 'application/json' },
});
});
}

function stats(interaction: any) {
return new Client({
loginOptions: {
},
}).getStats(interaction.data?.options[0]?.value);
}
}
4 replies
CDCloudflare Developers
Created by llamaz on 2/9/2025 in #pages-help
Running into CPU time limits
Any free/cheap way around this? I have an API route that uses an library that needs to do some crypto-related stuff (generate random RSA keys, uses sha256 etc.), and I believe this is causing the page to (sometimes) go over the limit. Any advice?
3 replies
NNuxt
Created by llamaz on 1/18/2025 in #❓・help
HTML comment tags causing warnings/errors in .server.vue component
Whenever I create a comment (<!-- ... -->) in my HTML, I get an odd string of hydration errors that cause my app to crash. https://privatebin.net/?77ae5652841229d7#4nxzsmU7EeeAYnfou1YcobhsnZ9pLcpUeCEwbA8PQbfp This seems to be only occurring on server components, and still persists after deleting various temp directories, reinstalling packages and using different runtimes. Dependencies: @azure/cosmos@4.2.0 @iconify-json/mdi@1.2.2 @iconify-json/svg-spinners@1.2.2 @nuxt/icon@1.10.3 @nuxt/ui@2.20.0 @nuxthub/core@0.8.10 @nuxtjs/i18n@9.1.1 UNMET OPTIONAL DEPENDENCY @rollup/rollup-linux-x64-gnu@4.9.5 @supabase/supabase-js@2.47.14 daisyui@4.12.22 date-fns@4.1.0 dayjs@1.11.13 lodash.debounce@4.0.8 moment@2.30.1 nuxt@3.15.0 posthog-js@1.203.1 tailwindcss@3.4.17 vite-bundle-analyzer@0.16.0 vue-router@4.5.0 vue@3.5.13 wrangler@3.99.0
6 replies
NNuxt
Created by llamaz on 7/17/2024 in #❓・help
Links in Nuxt UI table
As per the title, I want to add something like an href individually, for every row. IS something like that possible?
2 replies