zszszsz
04/28/2023, 10:11 PMzszszsz
04/28/2023, 10:12 PMRangeError: Maximum call stack size exceeded
on deployed env, can you get more logs for thatzszszsz
04/28/2023, 10:13 PMspacey
04/28/2023, 10:16 PMzszszsz
04/28/2023, 10:17 PMspacey
04/28/2023, 10:18 PMspacey
04/28/2023, 10:18 PMzszszsz
04/28/2023, 10:18 PMwrangler pages deployment tail
?spacey
04/28/2023, 10:19 PMzszszsz
04/28/2023, 10:20 PMconsole.log
more and tail again ?spacey
04/28/2023, 10:20 PMapp.onError((e, c) => {
console.error(`ERR2: ${e}`);
return c.text("something wrong", 500);
});
spacey
04/28/2023, 10:21 PMe
kian
04/28/2023, 10:21 PMe.stack
spacey
04/28/2023, 10:21 PMLloyd
04/28/2023, 10:21 PMspacey
04/28/2023, 10:22 PMzszszsz
04/28/2023, 10:23 PMLloyd
04/28/2023, 10:23 PMspacey
04/28/2023, 10:23 PM(error) ERR2: RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
at Context.notFound (functionsWorker-0.6040202837308641.js:496:7)
at Context.notFoundHandler (functionsWorker-0.6040202837308641.js:1719:23)
at Context.notFound (functionsWorker-0.6040202837308641.js:496:19)
at Context.notFoundHandler (functionsWorker-0.6040202837308641.js:1719:23)
at Context.notFound (functionsWorker-0.6040202837308641.js:496:19)
at Context.notFoundHandler (functionsWorker-0.6040202837308641.js:1719:23)
at Context.notFound (functionsWorker-0.6040202837308641.js:496:19)
at Context.notFoundHandler (functionsWorker-0.6040202837308641.js:1719:23)
at Context.notFound (functionsWorker-0.6040202837308641.js:496:19)
at Context.notFoundHandler (functionsWorker-0.6040202837308641.js:1719:23)
kian
04/28/2023, 10:23 PMzszszsz
04/28/2023, 10:24 PMspacey
04/28/2023, 10:24 PMconst app = new Hono().basePath("/api");
app.post("/signup", async (c) => {
...
}
export const onRequest = handle(app);
spacey
04/28/2023, 10:24 PM/api/signup
spacey
04/28/2023, 10:25 PMspacey
04/28/2023, 10:25 PMspacey
04/28/2023, 10:26 PMkian
04/28/2023, 10:28 PM/signup
?spacey
04/28/2023, 10:29 PMconst { firstName, email: rawEmail } = await c.req.json();
if (!firstName) return error(c, "firstName missing");
if (!rawEmail) return error(c, "email missing");
const [user, host] = rawEmail.split("@");
const email = [user.replaceAll(/(\.)|(\+.*)/g, ""), host].join("@");
const { country, city, timezone } = c.req.raw.cf;
const data = {
email,
firstName,
country,
city,
timezone,
};
const db = new D1QB(c.env.DB_PROD);
const inserted = await db.insert({
tableName: "users",
data,
returning: "id",
});
await c.env.Q_SIGNUPS.send(user);
return c.json({
id: inserted.results.id,
});