POST server functions returning 500
This happens only when deployed to Vercel (locally it's working fine)
The relevant log I'm getting:
TypeError: f.split is not a function
23 Replies
fair-rose•6mo ago
can you please provide a complete minimal example as a git repo?
fascinating-indigo•6mo ago
yeah Im getting that today too... narrowed it down to a server function importing a
react-email
email
@mariusflorescu are you by chance using react-email?
same deal on my end though, works fine locally but gives me same error on Vercel
would love to know if you got it figured outconscious-sapphireOP•6mo ago
yes, it’s because of react-email
i honestly don’t know what to do
fascinating-indigo•6mo ago
I put put my resend / react-email imports in a separate helper file. This at least keeps my page from erroring. Still can't send emails using the react components from react-email, but can use html & text without issue
im working around it by just makign a html only version of my email I guess
conscious-sapphireOP•6mo ago
@JJ Rise is your setup a mono-repo?
fascinating-indigo•6mo ago
Yes
conscious-sapphireOP•6mo ago
Mhm I think that might be the issue.
This works just fine in a simple app, but not in the monorepo
have you managed to find a way to solve the issue @JJ Rise ?
passive-yellow•6mo ago
If you can provide a reproduction, I can help looking into that
There is sooo many ways to do monorepos that without a reproduction it's hard to help (build/no build, tspath alias/workspace/project reference, one entry per lib/multiple entry per lib, etc)
fascinating-indigo•6mo ago
Sorry @mariusflorescu I have no yet. Just using html and text as a simple workaround for now
fair-rose•6mo ago
@JJ Rise any chance you can provide a reproducer?
conscious-sapphireOP•5mo ago
@Manuel Schiller @Nicolas Beaussart
https://github.com/mariusflorescu/tanstack-start-resend-issue
GitHub
GitHub - mariusflorescu/tanstack-start-resend-issue
Contribute to mariusflorescu/tanstack-start-resend-issue development by creating an account on GitHub.
conscious-sapphireOP•5mo ago
I included the steps to reproduce
Sorry... took long but i didn't have time to do it since it took some time
passive-yellow•5mo ago
I'll try to look at it tonight or this weekend! Thanks for the repro
conscious-sapphireOP•5mo ago
thanks. you might need also to do export ENV_VAR= before running the pnpm start
passive-yellow•5mo ago
So I've looked at the repro, but I don't have a resend account so I wasn't able to reproduce the issue :/
I've tried to remove the resend part, and I don't seems to have an issue
Maybe it's the template part that vinxi is trying to parse ? But that's my biggest clue so far, nothing weird regarding resolution config, tsconfig path aliases are properly setup
Could you provide a full stacktrase ?
conscious-sapphireOP•5mo ago
But resend is free @Nicolas Beaussart
I’m going to give tou the full stacktrace
I guess so too that the issue its caused by the parsing of the React code. Text/raw html work fine. Only when I put a template this fails.
But is it vinxi or nitro that have this issue
passive-yellow•5mo ago
I know. But my kid is awake and I didn't had time to set one up before the end of nap time 😅
conscious-sapphireOP•5mo ago
I can create you one API key if you want
for 10-15 mins 😋
but my stacktrace will be the exact same as yours
Or another though is that somehow the import is failing for the template.
It is very weird that this fails only in monorepo situation.
passive-yellow•5mo ago
So. One thing you can try is to build the library with the template, so when nitro or vinxi reads the template lib, it's no longer jsx
conscious-sapphireOP•5mo ago
we should somehow get some more detailed logs… any idea how?
@JJ Rise are you using tailwind for templates?
fascinating-indigo•5mo ago
indeed
conscious-sapphireOP•5mo ago
So the guys from resend are opening an issue. The root cause seems to be the tailwind stuff.
We can close this topic here. Will ping you once I get an update.
fascinating-indigo•5mo ago
awesome, thank you @mariusflorescu !!