Joe
Joe2y ago

adding an http router makes undeployable

If I add an http.js file that just exports the router with no routes added in specific, I'm seeing errors. I'm not sure why though because it seems to be upset about other functions, but those are able to deploy when the http.js file isn't present, and these aren't called in the http file as yet. Error screenshot below:
No description
11 Replies
ballingt
ballingt2y ago
@Joe what's your http.js file look like? Are you using TypeScript or JavaScript?
Joe
JoeOP2y ago
.js file looks like this
No description
Joe
JoeOP2y ago
i tried taking everything out but get errors
ballingt
ballingt2y ago
@Joe are you using JavaScript files everywhere else?
Joe
JoeOP2y ago
i had crons.ts but that was it, if i change that to crons.js still fails i think, only other .ts file is schema
ballingt
ballingt2y ago
the httpRouter import looks odd, I don't think there is a httpRouter in ./_generated/server
Joe
JoeOP2y ago
Joe
JoeOP2y ago
is there another way to write ?
ballingt
ballingt2y ago
Oops, thanks for the docs bug report
import { httpRouter } from "convex/server";
import { httpAction } from "./_generated/server";
import { httpRouter } from "convex/server";
import { httpAction } from "./_generated/server";
Joe
JoeOP2y ago
ah tyyy - lemme try that works thanks!
Presley
Presley2y ago
We should improve the error message when this happens.

Did you find this page helpful?