Skip to content

Commit be0ff7b

Browse files
obraclaude
andcommitted
fix: enforce Node.js 20.18.3+ to resolve CSS URL scheme issues
- Add engines field to package.json requiring Node.js >=20.18.3 - Node.js 20.18.3 includes fix for URL scheme handling (nodejs/node#55471) - Resolves "The URL must be of scheme file" errors in CSS compilation - Add improved JSON parsing error handling in message API endpoint 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5a80b86 commit be0ff7b

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.0.1",
44
"type": "module",
55
"author": "Jesse Vincent <[email protected]>",
6+
"engines": {
7+
"node": ">=20.18.3"
8+
},
69
"bin": {
710
"lace": "./dist/cli.js",
811
"debug-thread": "./dist/debug-thread.js"

packages/web/app/api/threads/[threadId]/message/route.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ export async function POST(
4242
const threadId: ThreadId = asThreadId(threadIdResult.data);
4343

4444
// Parse and validate request body with Zod
45-
const bodyRaw: unknown = await request.json();
45+
let bodyRaw: unknown;
46+
try {
47+
bodyRaw = await request.json();
48+
} catch (error) {
49+
const errorResponse: ApiErrorResponse = {
50+
error: 'Invalid JSON in request body',
51+
};
52+
return NextResponse.json(errorResponse, { status: 400 });
53+
}
54+
4655
const bodyResult = MessageRequestSchema.safeParse(bodyRaw);
4756

4857
if (!bodyResult.success) {

packages/web/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.0.1",
44
"private": true,
55
"type": "module",
6+
"engines": {
7+
"node": ">=20.18.3"
8+
},
69
"scripts": {
710
"dev": "tsx watch server.ts",
811
"build": "next build",

0 commit comments

Comments
 (0)