Feathers JS Client Timeout - javascript

I am sure this is something very simple, but for some reason I am getting a timeout when trying to integrate the feathersjs client with a very simple jQuery app. Files of interest are in src below. This repo only contains a single service "messages" connected to a NedB database with no authentication. When the script starts, I am attempting to add a single message to my messages service.
Repo:
https://github.com/Ryan8765/jquery-chat
Error in Console:
Uncaught (in promise) Error: Timeout of 5000ms exceeded calling create on messages
at client.js:66

The server side application has been created with an old (v2) version of the CLI but you are loading #feathersjs/feathers#^3.0.0 in the browser which uses a Socket.io message format that is not supported by a v2 server.
feathers --version on the command line should show 3.3.0 or later. You can either follow the migration guide to upgrade or install the latest #feathersjs/cli and regenerate the application.
Reference issue feathersjs/feathers#761.

I had the same issue using these package's on the client side with vue.js (vue#^3.2.16 and vite#2.6.4)
#feathersjs/feathers#^4.5.11
#feathersjs/socketio-client#^4.5.11
socket.io-client#^2.3.1
#feathersjs/authentication-client#^4.5.11
My issue was resolved after changing
import io from "socket.io-client";
to
import io from "socket.io-client/dist/socket.io";
in my client feathersjs settings

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.

registering socket IO to vite for sveltekit

I have written a few apps using svelte and sapper and thought I would give sveltekit a go.
All in all it works, but I am now running into the issue of registering a worker on ther server.
Basically I am trying to add socket.io to my app because I want to be able to send and receive data from the server. With sapper this wasn't really an issue because you had the server.js file where you could connect socket.io to the polka/express server. But I cannot find any equivalent in sveltekit and vite.
I experimented a bit and I can create a new socket.io server in a route, but that will lead to a bunch of new problems, such as it being on a separate port and causing cors issues.
So I am wondering is this possible with sveltekit and how do you get access to the underlying server?
The #sveltejs/adapter-node also builds express/polka compatible middleware which is exposed as build/middelwares.js which you can import into a custom /server.cjs:
const {
assetsMiddleware,
prerenderedMiddleware,
kitMiddleware,
} = require("./build/middlewares.js");
...
app.use(assetsMiddleware, prerenderedMiddleware, kitMiddleware);
The node adaptor also has an entryPoint option, which allows bundling the custom server into the build, but I ran into issues using this approach.
Adapters are not used during development (aka npx svelte-kit dev).
But using the svelte.config.js you're able to inject socket.io into the vite server:
...
kit: {
...
vite: {
plugins: [
{
name: "sveltekit-socket-io",
configureServer(server) {
const io = new Server(server.httpServer);
...
},
},
],
},
},
Note: the dev server needs to be restarted to apply changes in the server code.
You could use entr to automate that.
You cannot connect to a polka/express server because depending on the adapter you choose there can be no polka/express server used - if you deploy to a serverless platform for example. Sockets for serverless are not so easy to implement and their implementation depend on the provider.
You are raising an important concern but right now I'm afraid this is not possible - someone corrects me if I'm wrong.
What you still can do is to write your front with SvelteKit, build it as a static/SPA/node application and then use your build from your own polka/express server. You lose the swift development experience offered by SvelteKit though, since your development will be parted in two: first the client, then the server.
EDIT
You can also use a data-pusher third service. They are straightforward to use but not necessarily free. Here is a list of data-pusher services from the Vercel page:
Ably
Pusher
PubNub
Firebase Realtime Database
TalkJS
SendBird
Supabase

ReactJS debugging with WebStorm connection_err

I am new to ReactJS and I am trying to debug it. I keep getting the following.
[Fiddler] The connection to 'localhost' failed.
Error: ConnectionRefused (0x274d).
System.Net.Sockets.SocketException No connection could be made because the target machine actively refused it 127.0.0.1:3000
This is my configuration in WebStorm:
Thanks, everyone, just got everything to work.
ReactJS is different from Angular.
We need to start the server manually by hand and just keep saving changes to app.js
1.Open nodeJS CMD
2. navigate to the project folder.
3. npm start
There you go!.

Port 8080 failing & startup.sh cannot be found when deploying Sails app to Azure

I've followed all the provided MS tutorials but still cannot get my sails app to run on Azure. I get the following log error. Can anyone help as to why these errors are happening?
Here is the official Azure deployment strategy for Sails.
https://github.com/mikermcneil/sails-deploy-azure
I have resolved my question. The error was created by an incorrect Redis URL. If you are using Redis ensure to add the Azure service Azure Cache for Redis and use the provided URL eg. redis://[your host name].redis.cache.windows.net:6380

Build succeeded for heroku app but running into "Application Error"

When I checked the Heroku build logs, it showed this:
The requested API endpoint was not found. Are you using the right HTTP verb (i.e. GET vs. POST), and did you specify your intended version with the Accept header?
My app runs on React framework for front end, and I use the Firebase realtime database for my backend. The app runs fine on my local server but when I try to deploy on to Heroku I run into this error.
My guess is that you didn't set the environment variables, thus the base url for your request might be invalid. You can set them in Settings tab of your heroku application, under the Config Vars section.

Categories