certified dirtiboi
certified dirtiboi
CDCloudflare Developers
Created by certified dirtiboi on 7/12/2024 in #next-on-pages
Hello Cloudflare community,
Okay so I got it working. I originally was using --force in my local instance but couldn't get it to work when building my application using wrangler (pages). I had to add some additional logic to ignore these warning when running the build with wrangler locally or remotely. I have been testing my production instance (next 14 & React 18) and my preview instance (next 15 & react 19) and I don't see the errors in my preview branch but see it quite often in my production instance. I'll continue to test, and hope to be able to push to production in the coming days. Thanks for all the help!
10 replies
CDCloudflare Developers
Created by certified dirtiboi on 7/12/2024 in #next-on-pages
Hello Cloudflare community,
@sochrisp My users are seeing the 500 a bunch the past few days so I'm attempting to upgrade to Ract 19 and Next.js 15 🙂 Are you using tanstack by chance? I'm facing a peer dependency issue when building and deploying that seems to be caused by a react 18 dependency by tanstack:
"node_modules/@tanstack/react-table": {
"version": "8.19.3",
"resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.19.3.tgz",
"integrity": "sha512-MtgPZc4y+cCRtU16y1vh1myuyZ2OdkWgMEBzyjYsoMWMicKZGZvcDnub3Zwb6XF2pj9iRMvm1SO1n57lS0vXLw==",
"license": "MIT",
"dependencies": {
"@tanstack/table-core": "8.19.3"
},
"engines": {
"node": ">=12"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
}
},
"node_modules/@tanstack/react-table": {
"version": "8.19.3",
"resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.19.3.tgz",
"integrity": "sha512-MtgPZc4y+cCRtU16y1vh1myuyZ2OdkWgMEBzyjYsoMWMicKZGZvcDnub3Zwb6XF2pj9iRMvm1SO1n57lS0vXLw==",
"license": "MIT",
"dependencies": {
"@tanstack/table-core": "8.19.3"
},
"engines": {
"node": ">=12"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
}
},
12:03:05.212 npm ERR! Could not resolve dependency: 12:03:05.213 npm ERR! peer react@">=16.8" from @tanstack/react-table@8.19.3 12:03:05.213 npm ERR! node_modules/@tanstack/react-table 12:03:05.213 npm ERR! @tanstack/react-table@"^8.19.3" from the root project 12:03:05.213 npm ERR! 12:03:05.213 npm ERR! Conflicting peer dependency: react@18.3.1 12:03:05.213 npm ERR! node_modules/react 12:03:05.213 npm ERR! peer react@">=16.8" from @tanstack/react-table@8.19.3 12:03:05.213 npm ERR! node_modules/@tanstack/react-table 12:03:05.214 npm ERR! @tanstack/react-table@"^8.19.3" from the root project 12:03:05.214 npm ERR! 12:03:05.214 npm ERR! Fix the upstream dependency conflict, or retry 12:03:05.214 npm ERR! this command with --force or --legacy-peer-deps 12:03:05.214 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
10 replies
CDCloudflare Developers
Created by certified dirtiboi on 7/12/2024 in #next-on-pages
Hello Cloudflare community,
will do
10 replies
CDCloudflare Developers
Created by certified dirtiboi on 7/12/2024 in #next-on-pages
Hello Cloudflare community,
@sochrisp Yes, to clarify, I still see this error intermittently. Based on my debugging, it has occurred on every one of my routes at one point or another, but it seems to occur most often when signing out of my app. Sometimes I can go a full day or two without seeing it and then the next day it happens a bunch. Interesting that upgrading react and Next.js has resolved it for you - maybe it's a caching related issue (my best guess). Unfortunately, I'm really hesitant to do those upgrades since my app is live in production and since next 15 is not quite stable yet (at least in my opinion) Thanks for the feedback though!
10 replies
DTDrizzle Team
Created by walkersyed581 on 9/21/2023 in #help
Trouble running JEST testing in Hono for Cloudfare Workers
This is how I have it set up - I pass the cloudflare account and D1 credentials in the dbCredentials node.
// If we are in production, we use the Cloudflare production database else we use the local database
export default defineConfig({
dialect: 'sqlite',
schema: './src/services/db/schema/*',
out: './migrations',
...(process.env.NODE_ENV === 'production'
? {
driver: 'd1-http',
dbCredentials: {
accountId: process.env.CLOUDFLARE_ACCOUNT_ID,
databaseId: process.env.CLOUDFLARE_D1_ID,
token: process.env.CLOUDFLARE_D1_TOKEN,
ssl: false
}
}
: {
dbCredentials: {
url: getLocalD1DB()
}
})
});
// If we are in production, we use the Cloudflare production database else we use the local database
export default defineConfig({
dialect: 'sqlite',
schema: './src/services/db/schema/*',
out: './migrations',
...(process.env.NODE_ENV === 'production'
? {
driver: 'd1-http',
dbCredentials: {
accountId: process.env.CLOUDFLARE_ACCOUNT_ID,
databaseId: process.env.CLOUDFLARE_D1_ID,
token: process.env.CLOUDFLARE_D1_TOKEN,
ssl: false
}
}
: {
dbCredentials: {
url: getLocalD1DB()
}
})
});
I then use a middleware like yours (but mine is its own file) to initialize the DB on the first hono request and reuse that connection on subsequent requests (as needed):
import { drizzle, DrizzleD1Database } from 'drizzle-orm/d1';

const schema = { schemas }; // change this to your schema/s

let db: DrizzleD1Database<typeof schema> | null = null;

export function getDbConnection(env: D1Database): DrizzleD1Database<typeof schema> {
if (!env) {
throw new Error("Environment variable for database is not defined");
}

if (!db) {
db = drizzle(env, { schema });
}

return db;
}
import { drizzle, DrizzleD1Database } from 'drizzle-orm/d1';

const schema = { schemas }; // change this to your schema/s

let db: DrizzleD1Database<typeof schema> | null = null;

export function getDbConnection(env: D1Database): DrizzleD1Database<typeof schema> {
if (!env) {
throw new Error("Environment variable for database is not defined");
}

if (!db) {
db = drizzle(env, { schema });
}

return db;
}
You might need to mess with the client settings since you seem to be using Turso. Also, I'm using wrangler which auto-generated an env.d.ts file that contains my Cloudflare env types that are needed to make a db connection.
8 replies
BRBuildShip + Rowy
Created by certified dirtiboi on 1/19/2024 in #❓・buildship-help
Buildship: Firestore Collection Query error
@Gaurav Chadha It works now. Thanks for the help!
8 replies
BRBuildShip + Rowy
Created by certified dirtiboi on 1/19/2024 in #❓・buildship-help
Buildship: Firestore Collection Query error
@Gaurav Chadha Has any progress been made on this? This is a major roadblock for me and the app I'm building. I essentially have been at a stand-still for a week because of this. thanks
8 replies
BRBuildShip + Rowy
Created by certified dirtiboi on 1/19/2024 in #❓・buildship-help
Buildship: Firestore Collection Query error
@Gaurav Chadha any update on this yet?
8 replies
BRBuildShip + Rowy
Created by certified dirtiboi on 1/19/2024 in #❓・buildship-help
Buildship: Firestore Collection Query error
thank you!
8 replies