Skip to content

Commit 6a32300

Browse files
committed
fix: use bcryptjs instead of bcrypt to avoid build error
1 parent c57328a commit 6a32300

File tree

3 files changed

+268
-623
lines changed

3 files changed

+268
-623
lines changed

app/seed/route.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import bcrypt from 'bcrypt';
2-
import postgres from 'postgres';
3-
import { invoices, customers, revenue, users } from '../lib/placeholder-data';
1+
import bcrypt from "bcryptjs";
2+
import postgres from "postgres";
3+
import { invoices, customers, revenue, users } from "../lib/placeholder-data";
44

5-
const sql = postgres(process.env.POSTGRES_URL!, { ssl: 'require' });
5+
const sql = postgres(process.env.POSTGRES_URL!, { ssl: "require" });
66

77
async function seedUsers() {
88
await sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`;
@@ -23,7 +23,7 @@ async function seedUsers() {
2323
VALUES (${user.id}, ${user.name}, ${user.email}, ${hashedPassword})
2424
ON CONFLICT (id) DO NOTHING;
2525
`;
26-
}),
26+
})
2727
);
2828

2929
return insertedUsers;
@@ -48,8 +48,8 @@ async function seedInvoices() {
4848
INSERT INTO invoices (customer_id, amount, status, date)
4949
VALUES (${invoice.customer_id}, ${invoice.amount}, ${invoice.status}, ${invoice.date})
5050
ON CONFLICT (id) DO NOTHING;
51-
`,
52-
),
51+
`
52+
)
5353
);
5454

5555
return insertedInvoices;
@@ -73,8 +73,8 @@ async function seedCustomers() {
7373
INSERT INTO customers (id, name, email, image_url)
7474
VALUES (${customer.id}, ${customer.name}, ${customer.email}, ${customer.image_url})
7575
ON CONFLICT (id) DO NOTHING;
76-
`,
77-
),
76+
`
77+
)
7878
);
7979

8080
return insertedCustomers;
@@ -94,8 +94,8 @@ async function seedRevenue() {
9494
INSERT INTO revenue (month, revenue)
9595
VALUES (${rev.month}, ${rev.revenue})
9696
ON CONFLICT (month) DO NOTHING;
97-
`,
98-
),
97+
`
98+
)
9999
);
100100

101101
return insertedRevenue;
@@ -110,7 +110,7 @@ export async function GET() {
110110
seedRevenue(),
111111
]);
112112

113-
return Response.json({ message: 'Database seeded successfully' });
113+
return Response.json({ message: "Database seeded successfully" });
114114
} catch (error) {
115115
return Response.json({ error }, { status: 500 });
116116
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@heroicons/react": "^2.2.0",
1010
"@tailwindcss/forms": "^0.5.10",
1111
"autoprefixer": "10.4.20",
12-
"bcrypt": "^5.1.1",
12+
"bcryptjs": "^3.0.2",
1313
"clsx": "^2.1.1",
1414
"next": "latest",
1515
"next-auth": "5.0.0-beta.25",
@@ -23,7 +23,6 @@
2323
"zod": "^3.24.1"
2424
},
2525
"devDependencies": {
26-
"@types/bcrypt": "^5.0.2",
2726
"@types/node": "22.10.7",
2827
"@types/react": "19.0.7",
2928
"@types/react-dom": "19.0.3"

0 commit comments

Comments
 (0)