How to get SvelteKit forms working in Vercel/Netlify/etc - deployment

I'm pretty new to Svelte but it is nice and straightforward in general with this form submission I have spent hours and it is driving me crazy as it doesn't make any sense why it is not sometimes working in Vercel.
I created a separate minimal SvelteKit project that submits the form to this webhook.site endpoint and it works perfectly in localhost but in Vercel deployment it works sometimes. Works once, then doesn't work three times, ten works four times in a row, then doesn't work again. Random. Sometimes Vercel gives an error, sometimes not. Here's the error:
[POST] /?/create
22:12:29:53
TypeError: fetch failed
at fetch (/var/task/node_modules/undici/index.js:105:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/var/task/node_modules/undici/lib/core/connect.js:176:24)
at /var/task/node_modules/undici/lib/core/connect.js:123:46
at Immediate._onImmediate (/var/task/node_modules/undici/lib/core/connect.js:164:9)
at process.processImmediate (node:internal/timers:471:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
}
Then, without doing anything I tested again and it was working like 20 times in a row. I left it like that and came back after ~1h and it was still working like 10 times per row. I was here.
Then I decided to start experimenting again and in the next commit I removed the header authentication that isn't needed for the webhook.site but I had it there because, during the endless hours of hassling with it, I got at some point "feeling" that if the not used HASURA_ADMIN_SECRET ENV variable is there then it works more often. I know it is nonsense. It stopped working for good. Tested at least 20+ times with some breaks to be sure. Also tried multiple other endpoints that work brilliantly from a simple PHP script I created, from reqbin.com or from Postman. I have tried everything.
Allright, then I thought I was right - that magical HASURA_ADMIN_SECRET is needed so I added it back. That didn't fix the issue. Tried dozen of times and then although I made sure I added that header auth back properly I decided also to roll back to the version where it was stable working for so long as seen here. Now even that doesn't work anymore.
I tried long ago to deploy to Netlify and CloudFare, too as I suspected it is Netlify issue but I failed to even get the site working. So I decided to spend more time on getting it working in Netlify and when I got it working I got exactly the same error as in Netlify https://i.imgur.com/repNxyf.png so here's my dead end.
(I will make this post shorter once I get sorted)

Related

Suddenly receiving firebase database error when logging in through app: " Evaluation error: NSURLErrorDomain: -1003"

I am currently working on an IOS app built through Swift on Xcode. Firebase packages are installed using Cocoapods, and all pods are updated. Additionally, I double-checked that the Plist and Google-Service Info files are correct.
This is the full error line I receive when logging into the app and trying to retrieve user information from the database:
nw_proxy_resolver_create_parsed_array [C3.1.1 proxy pac] Evaluation
error: NSURLErrorDomain: -1003
I am unable to figure out how to resolve this issue as there were no changes in my code and it was working beforehand perfectly.
I can provide code snippets if needed but since the app was working prior, I am assuming this isn't related to my code.
The only time I was able to solve this issue temporarily was to reset the package caches through XCode, allowing me to view posts and other content pulled from the firebase backend. Unfortunately, after I restarted the app, this solution did not work anymore, and the same error from above popped up. Since resetting the package caches worked initially, I am assuming there is no direct correlation between the error and my source code.
Does anyone have any idea as to ways I can solve this issue? It has prevented me from working on my app for several days now. Thanks for any help!
Update: After looking over my code one more time, I found that there was a missing dot in a line of code, leading to my IOS app not running. This did NOT solve the error of nw_proxy_resolver_create_parsed_array [C3.1.1 proxy pac] Evaluation error: NSURLErrorDomain: -1003, but since the app is working successfully, my problem is solved.

Flutter and Firebase Analytics - events are not logged (but sometimes works)

I have a simple application, to which I just added Firebase.
Since 4 days I am trying to make it work, and yesterday finally I started seeing events coming in DebugView (which proves that I configured it correctly). It was moment of pure joy, as each single event was recorded in DebugView (no matter how many times I clicked a button -> all events reached Firebase).
This happiness didn't last long however.
Today it stopped work, but not like "never works", but it skips like 95-99% of events (some events sometimes gets to DebugView. Wow! Pure magic.
Using logcat, I can see all events are successfully uploaded/sent.
I wonder if there is any undocumented "magical" thing that might me blocking my events?
Or is Firebase down today (21st Sept 2022)?
Please note that:
When my events passes - it shows "1" in USERS IN LAST 30 MINUTES which is correct.
When events are not reaching DebugView, then nothing is shown in USERS IN LAST 30 MINUTES (which basically means that it is not only problem with DebugView - but actually no activity is reaching Firebase AT ALL).
Following picture proves that some events reached Firebase (but dozens other events, like screen_view or my custom dummy_event never got there).
Last picture proves that my events actually are successfully sent.
EDIT 25th Sept 2022
I deleted Firebase project and created a new one, run flutterfire configure and guess what? It started to work WITHOUT any other change in the code. (please note that I was running flutterfire configure many time for previous firebase project as well, without any result).
I am frustrated that I wasted few hours on looking for a bug in my code, while it was some "magic" on Firebase side that simply made it NOT WORKING.
So do you think it is over now? And that everything works?
You can't be farther from truth.
This image shows that there was 1 active user. Yes, it was me debugging app using DEBUG build. So since it was working, and decided to make final release build to my device (flutter run --release) and guess what?
Yeap - nothing shows in Firebase again. Simply my release build, installed on my device does not shows any activity on Firebase.
Is it because it was not downloaded from Google Play?
Is it because I have some misconfiguration?
Is it because Firebase has bug?
Who knows... Firebase is like Hogwart - full of magic.

ReactJS 5.3.0 not loading from unpkg.com

We have been using the following library for months:
https://unpkg.com/react#15.3.0/dist/react.min.js
Yes - I know we can just reference 15.3 and get the URL rewrite to the latest, but they released a breaking change. That's another issue for another day. Don't get distracted.
Yesterday this simply stopped working. You'll notice that if you load the URL mentioned, that the file is TRUNCATED. Simply cuts off. This made everything we use react with break. Interestingly, if you go to the following URL (without the .js extension) - things work.
https://unpkg.com/react#15.3.0/dist/react.min
My question is - what the heck happened? Why did the URL we've been using for 8 months suddenly stop working, and who can we get to fix it. In the interim, we had a copy locally that we've started referencing (which we probably should have been doing to begin with, since we don't want the automatic upgrade). When things like this happen, who do you inform?
I'm not sure you'll find the answer as to why this file is no longer working here but based off of the website you could reached out to the creator on twitter: https://twitter.com/mjackson
On the website it says:
SUPPORT
unpkg is a free, best-effort service and cannot provide any uptime or
support guarantees.
i.e. you should probably only use this link if you are messing around with a small project and shouldn't be used for any website where you actually care about the uptime of the site.

Why is Eclipse's HTML viewer randomly showing previous output and an error?

Well, this video shows my problem best : http://www.youtube.com/watch?v=yDeChV254Ck&feature=youtu.be
If I have a page that is proper/ok, everything works fine and as expected.
If I purposely induce an error (which I have been doing loads of whilst learning!), Eclipse doesn't show an error at all inline/red underline, and, when I try to run, it will either display an error (which I expect it should be doing every time), or it will randomly display the last successful build.
I can (remotely) understand the logic of alternating, maybe someone would want to see the previous output, but, this is just completely random - no logic at all, so, I just don't understand why it is happening.
Does anyone know what is going on?
edit - been able to recreate this on a brand new install. What is going on!?

Troubleshooting 500 Server Error Zend Framework application

I am facing a 500 Server Error and I see that many people here have had this problem and it can be too broad so I would like to ask my question differently.
I have confirmed with my host that the server is fine and if I replace content of index.php in public_html it shows everything is working. The problem seems to be in my script/environment and I am trying to track it down. My question is which are the common paths to check?
I have confirmed that its going through application.ini fine, the front controller plugin is fine (I have 1), the routing is working fine but it doesnt get as far as the IndexController which I am testing with.
I have tried to wrap $application->bootstrap()->run(); in a try-catch but this didnt help. Any help with how to troubleshoot such an issue appreciated. I am trying to track through what the application is doing to find where it fails.
I solved this problem. Turns out I had an infinite loop in my application in one model. I traced through the dispatch process until I narrowed down to the line that was causing trouble and removed it. Was helpful to me in walking through what the application does step by step and ticking off everything.