drizzle + express + ts errors
https://gist.github.com/barrybtw/67c379371c3f52a61758c94474e8ebf8
In regards to the route
auth_router.post("/signup", () => ...)
, I get this error
I don't seem to be breaking that so a bit confused?
And if I use a username that's already taken (username has the unique constraint) I get this error
PostgresError: duplicate key value violates unique constraint "user_username_unique"
, and I can't import the type PostgresError as it's not exported but it's part of the types in the node modules, yet I can't import it without runtime errors.
SyntaxError: The requested module 'postgres' does not provide an export named 'PostgresError'
2 Replies
status(201).redirect("/login");
feels like the most likely cause. I would be the header that is being updated is the status header, as function tries to set the header to 201 and then 301. I think you need one or the other?Forgot I had this but yeah returning void after is apparently a no no you should return the res.status().redirect or whatever you send
Left express as well fuck that using Honojs now 😂