-
-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Vercel Deploy #227
base: main
Are you sure you want to change the base?
[FIX] Vercel Deploy #227
Conversation
@artokun is attempting to deploy a commit to the Linkly AI LLC's projects Team on Vercel. A member of the Team first needs to authorize it. |
Closes #226 |
When trying out the fix on Vercel with an actual API call that is launching the browser, I get the following error:
|
Ah ok, let me take that for a spin then. might be a quick fix actually |
@jonico curl --location 'suno-api-sigma-smoky.vercel.app/api/generate' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A popular heavy metal song about war, sung by a deep-voiced male singer, slowly and melodiously. The lyrics depict the sorrow of people after the war.",
"make_instrumental": false,
"model": "chirp-v4",
"wait_audio": false
}' |
Are you sure that with the |
@artokun just tested with your Vercel instance and got the same error: ![]() |
Hi, same for me. Both /custom_generate and /generate endpoints are also throwing the error: { I have tried both BROWSER_HEADLESS=true and BROWSER_HEADLESS=false. The rest non sensitive env vars: BROWSER_LOCALE=en |
I see custom_generate is indeed throwing an issue, investigating |
I have tested 4 endpoints:
|
9ae1663
to
cb42a80
Compare
357518c
to
c3884ad
Compare
Took a hot minute but I got it working with vercel, @gohoski you were right, it was making the fake app, but now it's making real songs with the package you introduced originally.
|
Thanks for the fixes. I'm not getting that error anymore, but a vercel timeout. I had to change maxDuration to 60 in both src/app/api/custom_generate/route.ts and src/app/api/generate/route.ts because otherwise vercel throws an error (hobby/free tier maximum max time for serverless functions is 60 secs, https://vercel.com/docs/functions/runtimes#max-duration). I guess 60 secs is not enough at all, even if "wait_audio": false. I don't know if there could be a workaround by leveraging vercel's edge functions for generate and custom_generate, which are the most time consuming I think: "Functions using the Edge runtime do not have a maximum duration. They must begin sending a response within 25 seconds and can continue streaming a response beyond that time." |
@artokun 👍 Looks good, but please fix the npm package files to install rebrowser. Also, for a local deploy, it seems that we will install two browsers—first the @Sparticuz/chromium, then the original Playwright one. Is there any way to fix this and make it so @Sparticuz/chromium would be installed only for Vercel? Maybe we can use the @Sparticuz/chromium-min package. @maindconsultingservices To fix this, maybe we can develop a task system or a webhook as described in #228. |
Alright.
I was NOT able to:
Let me know if there is anything else you'd like to see, otherwise I think I reached my wits end on how to get this to work accross all environments |
Maybe we can land this PR then move to a streamable format using vercel's RSC streamable pattern |
Is there any more feedback to get this PR in? |
Seems to be good, but why did we suddenly move from |
There was a package.lock and a pnpm-lock in the repo, you can't have both so I deleted the npm one assuming the only reason the pnpm one was there was because it was desired. I can switch to the other no problem. Let me know if this is the case |
pnpm hasn't been used here for like 8 months, so I doubt that blueeon has plans on moving to pnpm. I didn't know that you can't have both though, thanks for letting me know. Right now I don't see any definite advantages of pnpm over other package managers. Right now npm serves everything we need, if we will have problems with it, then it will be reasonable to move. And we can actually just not move and run |
What is being used on Vercel though? pnpm or npm? |
At least when the pnpm update lock file is not up to date, Vercel complains about it not being up to date. I would recommend to test it out on vercel, it can be setup within minutes for free. |
I'll revert to npm |
Reverted back to NPM, deployed no issues on my end @gohoski |
Hi, I got this error message on build logs: And this error on /api/custom_generate |
I'm now on this crazy train too and happy to help debug and test. I've got my own fork of this stood up with this PR. Everything seems to be going well on the Playwright side so far but I'm hitting a timeout on the Suno front.
|
Don't set anything in vercel, let it handle it on its own |
See README section: |
I am on a pro account and have set those params. Again this is an error coming from await page.waitForResponse('**/api/project/**\\?**', { timeout: 60000 }); // wait for song list API call Looking at my Vercel logs I see: {"level":30,"time":1739813899351,"pid":3,"hostname":"169.254.84.187","msg":"Waiting for Suno interface to load"} Hangs there for 60 seconds and then times out |
Seems like the Suno interface just gets stuck loading indefinitely |
Unless I'm mistaken there are two issues here: a) the service assumes the captcha is not already showing and tries to trigger it (but if it is already showing the data it's waiting on never arrives thus the 60 second hang) |
The Cloudflare Turnstile CAPTCHA is very new for me. I almost never haven't seen it both on my main PC and my server. AFAIK, it is being shown only on IPs that are marked as a 'hosting'/VPN or such. The only way to solve this CAPTCHA is to develop a library that smoothly controls the mouse without any evaluations on the page, as they are being detected as seen in You can use the Browser Automation Studio's algorithm located in the source code of their old version. I will probably develop it on the next week, as I'm afraid that I will get it also. |
It's actually really easy to solve with 2captcha. You just grab the sitekey and pass it to the hcaptcha endpoint. The token you get back works for the generation endpoint. The problem I'm having now is every single request pops up a captcha and when generating 100% of my gens have the "this is a fake app" lyrics. (I built my own version of this service for Cloudflare Workers fwiw) |
Seems if we got the headers a cookies right we could get the service thinking we were a mobile session and avoid captchas altogether or at least avoid detection off lack of mouse movement. (No mice on mobile) |
@kalepail This is why I went with the image coordinates endpoint instead. The hCaptcha endpoint does not support the 'hidden' hCaptcha variant, as said by the 2Captcha Support team. I might look into emulating a mobile device instead, HOWEVER, it is actually very hard to emulate a mobile device and not get detected. There always will be leaks such as navigator properties, and even then mobile devices still get a CAPTCHA—hell, even the mobile app, which I 'reverse engineered' (kinda) via HTTP Toolkit, has the hCaptcha. It doesn't have Cloudflare Turnstile though, so that's why I went with that route when the hCaptcha is not needed. To solve the Cloudflare CAPTCHA, it seems that I need to move to Kaliiiiiiiiii-Vinyzu/patchright-nodejs and develop a good enough library to automatically control the mouse as a human. However, if you are on a Windows machine that has already used Suno before, you'll probably not get it right now. |
If you get a Cloudflare challenge page (suno.com needs to review the security of your connection before proceeding), add |
After a lot of digging, I have decided that it is going to be too unsuccessful and unmaintainable to try to solve the Cloudflare Turnstile CAPTCHA itself. If you happen to have this CAPTCHA, your best bet is to use proxies, try to use Suno itself on the machine for a few tries, change the user-agent, etc. However, I will be making a PR to support proxies for this matter. Maybe it is possible to solve the Cloudflare CAPTCHA using 2Captcha's corresponding endpoint, but I'm not sure. I will give it a shot though. |
This works, thank you |
This PR fixes the Vercel deploy by using the internal playwright packaged used in Vercel VMs
Added new packages:
playwright-core
@sparticuz/chromium
Removed:
Edited:
Screen.Recording.2025-01-30.at.1.43.06.PM.mov