bkyerv
bkyerv
Explore posts from servers
CDCloudflare Developers
Created by bkyerv on 11/17/2023 in #workers-help
Troubleshooting Hono with Cloudflare Durable Objects Implementation Error
I'm currently working on integrating Hono with Cloudflare Durable Objects following this (url: https://github.com/honojs/examples/tree/main/durable-objects/src) example: Hono Example. However, I've run into a snag and need some help troubleshooting. My implementation, which is essentially a replica of the original example, can be found here: My Hono Implementation (url: https://github.com/bkyerv/hono-cloudfalre-do/tree/main/src ). I'm encountering the following error:
Error:
service core:user:worker-lawyer: Uncaught TypeError: Class extends value undefined is not a constructor or null
at index.js:1677:44 in maskDurableObjectDefinition
at index.js:1686:16
✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
Error:
service core:user:worker-lawyer: Uncaught TypeError: Class extends value undefined is not a constructor or null
at index.js:1677:44 in maskDurableObjectDefinition
at index.js:1686:16
✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
7 replies
CDCloudflare Developers
Created by bkyerv on 11/3/2023 in #general-help
Issue with Setting Up Cloudflare Tunnel for Local Development
I'm attempting to establish a Cloudflare tunnel to grant access to applications and servers that are running locally during the development phase. However, I'm encountering an error while setting up the tunnel using cloudflared command used cloudflared tunnel --url http://localhost:3000 output I am seeing
INF Requesting new quick Tunnel on trycloudflare.com...
failed to parse quick Tunnel ID: invalid UUID length: 0
INF Requesting new quick Tunnel on trycloudflare.com...
failed to parse quick Tunnel ID: invalid UUID length: 0
2 replies
CDCloudflare Developers
Created by bkyerv on 11/3/2023 in #general-help
Issue with Updating Cloudflared using Homebrew
While attempting to update cloudflared as per the update instructions on https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/update-cloudflared/, I encountered an error during the upgrade process. Command used brew upgrade cloudflared Output:
brew upgrade cloudflared
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################### 100.0%
==> Upgrading 1 outdated package:
cloudflare/cloudflare/cloudflared 2023.3.1 -> 2023.8.2
==> Fetching cloudflare/cloudflare/cloudflared
==> Downloading https://packages.argotunnel.com/dl/cloudflared-2023.8.2-darwin-a
curl: (22) The requested URL returned error: 522 # # # #

Error: cloudflared: Failed to download resource "cloudflared"
Download failed: https://packages.argotunnel.com/dl/cloudflared-2023.8.2-darwin-amd64.tgz
brew upgrade cloudflared
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################### 100.0%
==> Upgrading 1 outdated package:
cloudflare/cloudflare/cloudflared 2023.3.1 -> 2023.8.2
==> Fetching cloudflare/cloudflare/cloudflared
==> Downloading https://packages.argotunnel.com/dl/cloudflared-2023.8.2-darwin-a
curl: (22) The requested URL returned error: 522 # # # #

Error: cloudflared: Failed to download resource "cloudflared"
Download failed: https://packages.argotunnel.com/dl/cloudflared-2023.8.2-darwin-amd64.tgz
2 replies
CDCloudflare Developers
Created by bkyerv on 9/6/2023 in #workers-help
Cloudflare Worker "exceeded CPU" Error on Auth Endpoint - Seeking Troubleshooting Insights
I've set up a Cloudflare Worker to handle an authentication endpoint. However, I'm encountering an error that states 'exceeded CPU'. I'm trying to understand the potential causes for surpassing the allocated CPU bandwidth. Any insights or troubleshooting suggestions would be greatly appreciated.
app.post('/signup', async (c) => {
const { email, password } = await c.req.json();
const auth = initializeAuth(c.env.TURSO_DB_URL, c.env.TURSO_AUTH_TOKEN);

try {
const userDetails = await auth
.createUser({
key: {
providerId: 'email',
providerUserId: email,

password,
},
attributes: {},
})
.catch(console.log);
console.log(userDetails);
return c.json({ status: 'ok' });
} catch (e) {
return c.json({ status: 'error', message: e });
}
});
app.post('/signup', async (c) => {
const { email, password } = await c.req.json();
const auth = initializeAuth(c.env.TURSO_DB_URL, c.env.TURSO_AUTH_TOKEN);

try {
const userDetails = await auth
.createUser({
key: {
providerId: 'email',
providerUserId: email,

password,
},
attributes: {},
})
.catch(console.log);
console.log(userDetails);
return c.json({ status: 'ok' });
} catch (e) {
return c.json({ status: 'error', message: e });
}
});
6 replies
DTDrizzle Team
Created by bkyerv on 8/27/2023 in #help
Strugling to use composite key in schema
How do I represent composite primary key in drizzle way (sqlite) below migration query? I red the docs but failed miserable in trying to implement it.
CREATE TABLE QuestionSetMapping (
SetID INTEGER,
QuestionID INTEGER,
PRIMARY KEY(SetID, QuestionID),
FOREIGN KEY(SetID) REFERENCES QuestionSets(SetID),
FOREIGN KEY(QuestionID) REFERENCES Questions(QuestionID)
);
CREATE TABLE QuestionSetMapping (
SetID INTEGER,
QuestionID INTEGER,
PRIMARY KEY(SetID, QuestionID),
FOREIGN KEY(SetID) REFERENCES QuestionSets(SetID),
FOREIGN KEY(QuestionID) REFERENCES Questions(QuestionID)
);
5 replies
DTDrizzle Team
Created by bkyerv on 8/4/2023 in #help
Discrepancies Between Raw SQL Queries and ORM Operations: Why Might They Behave Differently?
1 replies
CDCloudflare Developers
Created by bkyerv on 8/4/2023 in #general-help
accessing env vars outside of worker
Is it possible to access env vars that are defined in the wrangler.toml file outside of workers? In this particular case I need to pass connection url and auth token to drizzle config file. That file is located in the root of the project and has nothing to do with workers. I am hesitant to insert credential hardcoded as is in the config file
1 replies
CDCloudflare Developers
Created by bkyerv on 4/10/2023 in #pages-help
remix app deployed using pages
Has anyone come across a situation where an empty screen is rendered upon deployment? I have set env var node_version to 16.10
11 replies
CDCloudflare Developers
Created by bkyerv on 2/6/2023 in #pages-help
is it possible to pass runtime env variables to supabase project?
When deploying a vite based app that uses supabase to perform authentication of the users of the app is it possible to pass supabase env variables so that such env variables can be used in the runtime without being exposed on the client? Or is the only option is using workers/functions in order to use those vars without exposing on the client?
1 replies
CDCloudflare Developers
Created by bkyerv on 1/29/2023 in #workers-help
env variables get wiped out during deploying changes via cli (i.e. wrangler publish)
I noticed that the env variables I have set up for the worker via the dashboard get deleted every time I deploy changes to the worker vie cli using wrangler publish. Is it an expected behavior?
2 replies