Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ node_modules

# generated files
/app/components/ui/icons
/app/utils/prisma-generated.server
.react-router/
2 changes: 1 addition & 1 deletion app/routes/_auth+/webauthn+/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function action({ request }: Route.ActionArgs) {
data: {
id: credential.id,
aaguid,
publicKey: Buffer.from(credential.publicKey),
publicKey: new Uint8Array(credential.publicKey),
userId,
webauthnUserId,
counter: credential.counter,
Expand Down
5 changes: 2 additions & 3 deletions app/routes/users+/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { searchUsers } from '@prisma/client/sql'
import { Img } from 'openimg/react'
import { redirect, Link } from 'react-router'
import { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'
import { ErrorList } from '#app/components/forms.tsx'
import { SearchBar } from '#app/components/search-bar.tsx'
import { prisma } from '#app/utils/db.server.ts'
import { searchUsers } from '#app/utils/prisma-generated.server/sql/searchUsers.ts'
import { cn, getUserImgSrc, useDelayedIsPending } from '#app/utils/misc.tsx'

Check warning on line 8 in app/routes/users+/index.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`#app/utils/misc.tsx` import should occur before import of `#app/utils/prisma-generated.server/sql/searchUsers.ts`
import { type Route } from './+types/index.ts'

export async function loader({ request }: Route.LoaderArgs) {
Expand All @@ -14,8 +14,7 @@
return redirect('/users')
}

const like = `%${searchTerm ?? ''}%`
const users = await prisma.$queryRawTyped(searchUsers(like))
const users = await prisma.$queryRawTyped(searchUsers(`%${searchTerm ?? ''}%`))
return { status: 'idle', users } as const
}

Expand Down
2 changes: 1 addition & 1 deletion app/utils/auth.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'node:crypto'
import { type Connection, type Password, type User } from '@prisma/client'
import { type Connection, type Password, type User } from '#app/utils/prisma-generated.server/client.ts'

Check warning on line 2 in app/utils/auth.server.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`#app/utils/prisma-generated.server/client.ts` import should occur after import of `remix-utils/safe-redirect`
import bcrypt from 'bcryptjs'
import { redirect } from 'react-router'
import { Authenticator } from 'remix-auth'
Expand Down
4 changes: 2 additions & 2 deletions app/utils/db.server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { styleText } from 'node:util'
import { remember } from '@epic-web/remember'
// Changed import due to issue: https://github.com/remix-run/react-router/pull/12644
import { PrismaClient } from '@prisma/client/index.js'
import { PrismaClient } from '#app/utils/prisma-generated.server/client.ts'

export const prisma = remember('prisma', () => {
// NOTE: if you change anything in this function you'll need to restart
Expand All @@ -14,6 +13,7 @@ export const prisma = remember('prisma', () => {
log: [
{ level: 'query', emit: 'event' },
{ level: 'error', emit: 'stdout' },
{ level: 'info', emit: 'stdout' },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: PrismaClient Missing SQLite Adapter

The PrismaClient in app/utils/db.server.ts is instantiated without the SQLite driver adapter. Since the schema uses engineType = "library", Prisma requires this adapter, and its omission will cause database connection failures at runtime.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursor, this is too noisy.

Suggested change
{ level: 'info', emit: 'stdout' },

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on it! I'll start making changes in this branch.

Open in Cursor Open in Web

{ level: 'warn', emit: 'stdout' },
],
})
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default [
rules: { 'react-hooks/rules-of-hooks': 'off' },
},
{
ignores: ['.react-router/*'],
ignores: ['.react-router/*', './app/utils/prisma-generated.server/**'],
},
]
Loading
Loading