llamaz
llamaz
Explore posts from servers
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/[email protected] @iconify-json/[email protected] @iconify-json/[email protected] @nuxt/[email protected] @nuxt/[email protected] @nuxthub/[email protected] @nuxtjs/[email protected] UNMET OPTIONAL DEPENDENCY @rollup/[email protected] @supabase/[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
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