Faith
Faith
Explore posts from servers
NNuxt
Created by Faith on 11/19/2024 in #❓・help
vueDemi2.effectScope is not a function
No description
21 replies
PPrisma
Created by Faith on 4/24/2024 in #help-and-questions
Error validating datasource `db`: the URL must start with the protocol `prisma://`
Hello everyone! Im currently getting this problem that i descriped in the title. where when i try to run Prisma on cloudflare workers i tried the soultion from here "https://www.prisma.io/docs/orm/reference/prisma-client-reference#programmatically-override-a-datasource-url" but cant seem to get it to work .dev.vars DATABASE_URL="DATABASE_URL=postgresql://postgres:@localhost:5432/postgres?schema=test" this is my prisma client
import { PrismaClient } from "@prisma/client/edge";

export const db = new PrismaClient({
datasources: {
db: {
url: 'file:../src/dev.vars',
},
},
})
import { PrismaClient } from "@prisma/client/edge";

export const db = new PrismaClient({
datasources: {
db: {
url: 'file:../src/dev.vars',
},
},
})
my schema.prisma
generator client {
provider = "prisma-client-js"
engineType = "binary"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
engineType = "binary"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
and when i try to add "prisma://" in the front it says "api key needed"
17 replies
CDCloudflare Developers
Created by Faith on 4/18/2024 in #workers-help
inconsistent error with Cloudflare worker queues. TypeError: Can't read from request stream because
Hello guys, im currently working on a POC where i try and make a nice starter template. im currently getting this issue when trying to run my queue and read the response "TypeError: Can't read from request stream because client disconnected." i would also like to add that it works sometimes but then when i refresh it throws that error this is my code
import { Hono } from 'hono'
import { logger } from 'hono/logger'

type Environment = {
readonly MY_QUEUE: Queue<any>;
};

const app = new Hono<{
Bindings: Environment;
}>();

app.use(logger())

app.get('/', (c) => {
c.env.MY_QUEUE.send({"hello": "world"})
return c.text('Hello Hono!')
})

export default {
fetch: app.fetch,
scheduled: async (event, env, ctx) => {
// console.log("scheduled: ", event, env, ctx)
},
async queue(batch: MessageBatch, env: Environment) {
let file = "";
for (const message of batch.messages) {
console.log(message)
const error = message.body;

file += error.hello + "\n";
}

console.log(file)
},
}
import { Hono } from 'hono'
import { logger } from 'hono/logger'

type Environment = {
readonly MY_QUEUE: Queue<any>;
};

const app = new Hono<{
Bindings: Environment;
}>();

app.use(logger())

app.get('/', (c) => {
c.env.MY_QUEUE.send({"hello": "world"})
return c.text('Hello Hono!')
})

export default {
fetch: app.fetch,
scheduled: async (event, env, ctx) => {
// console.log("scheduled: ", event, env, ctx)
},
async queue(batch: MessageBatch, env: Environment) {
let file = "";
for (const message of batch.messages) {
console.log(message)
const error = message.body;

file += error.hello + "\n";
}

console.log(file)
},
}
1 replies