Heroku reCaptcha in node.js app - javascript

I'm trying to integrate reCaptcha to my node'js app. When I run the app locally everything's fine. But when I deploy the app to heroku, reCaptcha prints an error and is blocked for usage. If I open the console in browser I see Failed to load resource: the server responded with a status of 400 (Bad Request) from https://google.com/...
I guess that heroku blocks something, but just googling it didn't help.
Thanks for your support.

Without more information, it seems most likely that the domain of your Heroku app is not listed in your reCAPTCHA account, or your site-key is not set correctly.

Related

Netlify throws 404 error with /graphql only when deployed

I have an app which I had pushed to heroku a few days ago, where it works fine, but when deploying the app to Netlify, the app deploys but the graphQL connection throws a 404 error. Here are some images.
Here is the code I use in App.js
Is there anyone that knows how I can fix this? Much appreciated
Netlify doesn't run a app server like Heroku, it only runs a static file server. From your code, it appears that you're trying to serve a app that you could connect to and provide yourself with GraphQL access. This is not possible on Netlify, at least not directly.
The only server-like solution that Netlify currently provides in Netlify Functions. However, those are limited to 10 sec by default and provide, one-time data connection - not something that you could keep on using for GraphQL.
So if your requirement is to keep the GraphQL server running (for example like what Gatsby does during gatsby develop), Netlify is not the solution for you. If you wish to send the data one-time and add some server-side processing, you can take a look at Netlify Functions.

Failed to register service-worker TypeError - Expo Error

I have recently encountered the following error when I npm run start my expo app;
Uncaught DOMException: Failed to execute 'importScripts' on
'WorkerGlobalScope': The script at
'http://localhost:19006/service-worker.js' failed to load.
at http://localhost:19006/expo-service-worker.js:93:6
The script has an unsupported MIME type ('text/html').
This error has never occurred until of late, in which I pulled down the app source code onto a new machine, so I have a incline that this could be the issue.
When I used to Service Worker debugger using Chrome Dev Tools, the error flags up on the last line of the code in expo-service-worker.js (see screenshot)
I have literally done nothing different, I have seen other solutions stating I should modify some of the service-worker registration code, but this sits uncomfortable with me being as this is an automatic process when running the app.
The app boots-up fine, but it has trouble connecting to the external api linked to the app, because the service worker is not being registered.
One my other machine, the app launches, registers a service worker and connects to the api fine, just not on the machine currently.
Any suggestions?
Thanks.
A service worker importScripts() script must be served with a valid javascript content-type header. See:
https://w3c.github.io/ServiceWorker/#dfn-bad-import-script-response
In this case you are getting a content-type of text/html. One common way this can happen is if the server returns a 404 for the resource URL passed to importScripts.

Websockets to Heroku are giving a 404 on chrome/firefox

I have my Django application deployed on heroku. It uses websockets, and everything is configured properly. When I go to my site, the websockets fail with WebSocket connection to 'wss://<url>' failed: Error during WebSocket handshake: Unexpected response code: 404. I did some digging and it's apparently due to chrome blocking the websockets? I came across this issue which sounds like what I'm getting, but the answer did not fix it for me.
Can someone explain what's going on here, and potentially how to fix it?
So the solution was nothing to do with heroku. I was using gunicorn to deploy my application, and that does not support websockets, so when the website hit my websocket endpoint gunicorn threw back a 404. I switched to daphne, and added web: daphne <application>.asgi:application --port $PORT --bind 0.0.0.0 to the Procfile, and everything started working. This blog post from Heroku helped me out, most specifically This segment.
try using https://<url> inspite of using wss i came across the same issue when i deployed my node.js application on heroku.
hope this will solve your problem too.

ReactJS could not proxy request from localhost:3000 to localhost:3003

I am writing a SPA using create-react-app and am using an expressjs server as my backend. For development I run my frontend test server on port 3000 and my backend expressjs test server on 3003.
I make many API calls client side using Axios so for development convenience I have defined proxy: "http://localhost:3003" in my package.json
This works fine on my laptop, but when running on my workstation I constantly get the error when accessing my app:
Proxy error: Could not proxy request /sockjs-node/487/wrst1bub/websocket from localhost:3000 to http://localhost:3003/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
I have no idea where this is coming from and I do not use sockjs in any capacity as far as I know. This is a console error and it does not crash my app but it is very annoying and I would like to get rid of it. Any help is greatly appreciated.
In my case, I was using Firefox and for some reasons, it gives me the same error. I tried to use Chrome and it worked!

MeteorJS App not working correctly after *.meteor.com deploy

I've recently finished up a project in meteor for a contest, and am having trouble deploying to *.meteor.com.
The deploy itself works, as you can see here, but neither my dynamic templates on the home page that should show posts appear/work, nor can you create an account, etc. I believe I may have an issue with my routing.
I believe this may be a routing issue. I'm using version 0.9.1. The source code can be found here.
Any thoughts? Running locally it works great, and deploying with the --debug features doesn't help. No errors are present in the console.
The problem may be coming from your links to external scripts in your head tag. These should instead be loaded through a package.
Visiting your site my console reads:
Failed to load resource: the server responded with a status of 403 (Forbidden)
http://use.typekit.net/c/765ffa/azo-sans-web:i4:i7:n4:n7:n9,proxima-nova:i4…a7a4dd7b8a278a2bbbafab3833d56270f9b83c60ccd331a8fd4b7d3712346dcd4c9f5ac346
That is coming from these scripts in your head tag:
<script type="text/javascript" src="//use.typekit.net/mkh6uio.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
See if loading them through a package corrects things.

Categories