_Pear
_Pear
Explore posts from servers
DDeno
Created by _Pear on 3/26/2024 in #help
Help with TypeScript namespaces - is this pattern supported?
Hi! I am attempting to model some classes in a Namespace for organization purposes. I would expect this pattern to work, the linter doesn't complain at least, but when I run deno test it fails with the error in the README. Is this not supported in Deno? I tried using triple slash directives as well but no luck. Thanks! https://github.com/CobyPear/deno-namespace-reproduction
6 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
IThis might be more of a Postgres question ,and my research has turned up that the answer is pretty much "No", but I was wondering if anybody has found a way to do this using Drizzle and custom types maybe? I want to store an array of primary keys in a table. I'm having trouble figuring out the correct way to do this. I would settle for using the a json type as well but that doesn't seem to work either given the type in the column of the reference table needs to be the same as the primary key, in this case uuid or text. Any ideas? Thanks!
7 replies
CDCloudflare Developers
Created by _Pear on 3/3/2024 in #pages-help
Trouble initializing wasm in SvelteKit
I am trying to use some of these @jsquash dependencies in a Pages app build with Sveltekit. I am able to get things building but when initializing the wasm during runtime, I get the following error:
Error: The 'credentials' field on 'RequestInitializerDict' is not implemented.
Error: The 'credentials' field on 'RequestInitializerDict' is not implemented.
I have searched the discord and seen some answers like "patch the module so it doesn't use credentials", and in this case it seems like vite's load is the thing using credentials. Has anybody had success using this or similar modules in SvelteKit on Pages and can give any advice? I've also tried the instructions here: https://github.com/jamsinclair/jSquash/blob/main/examples/cloudflare-worker-esm-format/src/index.js but those didn't work. Ideally I would make this work in SvelteKit itself and not need a separate worker, but that seems to be where this is leading. Thanks!
1 replies
CDCloudflare Developers
Created by _Pear on 2/27/2024 in #workers-help
Error: Handler does not export a fetch() for scheduled worker locally
Hi, I'm a bit confused. I just ran this scheduled worker locally using wrangler dev and hit the endpoint the curl command from the docs and it worked fine: curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" I tried again at a later time and got the following error:
Error: Handler does not export a fetch()
Error: Handler does not export a fetch()
I don't understand why it worked then started failing like this. Any suggestions?
3 replies
DDeno
Created by _Pear on 9/9/2023 in #help
KV list is returning an empty iterator, but data is there and gettable via get
Hello. To simplify things, I am setting a key of ["accounts", account.name] but when I try to get the accounts with kv.list({ prefix: ["accounts"] }), I always get an empty iterator back. I am able to see the record exist when using kv.get(). Here are the relevant snippets; what am I doing wrong, or is this a bug?:
const Db = await Deno.openKv();
//...
await Db.set(["accounts", account.username], account);

//...
const iter = Db.list({ prefix: ["accounts"] }); // why is this always empty?
for await (const row of iter) {
console.log(row);
}
const Db = await Deno.openKv();
//...
await Db.set(["accounts", account.username], account);

//...
const iter = Db.list({ prefix: ["accounts"] }); // why is this always empty?
for await (const row of iter) {
console.log(row);
}
6 replies