Open RareSecond opened 6 months ago
Hmm, seems like Vercel Build CLI has trouble importing JSX files. Taking a look.
So I stumbled upon this issue on the Vercel GH and contacted Vercel support with the details from this repro.
I'll try to see what exactly they know is going wrong and if there are ways around it!
We could probably transpile the JSX files before the vercel build step. Can take a look into it.
We are having the same issue. Are there any updates here?
Hey guys! Hitting the same issue. It's really annoying & hard to maintain everything in a single jsx api file. Do you have any new information on this issue?
Should we just ditch the vercel template and try to migrate to a nextjs one? Would hate to do that as I find the vercel one a lot easier to debug.
We deployed our project through Vercel by putting everything into one file. Horrible and hard to maintain...
Some people were able to deploy through Cloudflare workers. We weren't able to since Neynar uses Axios, and Cloudflare doesn't support Axios for some reason.
@RareSecond, in your reproducible example, there is a circular dependency issue. index.tsx
depends on Frame.tsx
and vice-versa.
For everyone having a pain of maintaining everything in a single file, there is a .route
method that allows you to join multiple frogs in one.
That's definitely something that has to be put in the docs.
Tried different approaches myself, can't fix.
Found a small improvement opportunity though: https://github.com/wevm/frog/pull/258
Any updates on this? Wondering if theres at least a work around that's not "put everything into a single file"
Also hitting this šš½āāļø
This bug is a huge bummer. Jamming components into the main index file isn't sustainable. Is the answer to simply migrate away from Vercel?
Jumping in here to see if there's any update on this. My frame is getting relatively complex and difficult to manage from a single file.
I'll make another push on this this weekend.
From my previous attempt I remember there was a limitation on Vercel side, that generally Serverless API handlers could not import other modules.
I'm importing modules into my api/index.tsx
file just fine. It's when the imported module contains JSX. It appears that those modules get stripped out entirely.
I created a minimal reproducible example.
This repository was started by running
bunx create-frog -t vercel
. Then the only change I did was extract the actual rendering of the frame into a separate file.This all works fine when running
bun run dev
locally.However, after deploying to Vercel (by running
bun run deploy
), the serverless function is crashing.This is the full error log from Vercel