publiclab / Leaflet.DistortableImage

A Leaflet extension to distort or "rubber sheet" images
https://publiclab.github.io/Leaflet.DistortableImage/examples/
BSD 2-Clause "Simplified" License
265 stars 284 forks source link

leaflet.distortableimage.js:5056 WebSocket connection to 'ws://localhost:8081/ws' failed: #1393

Open Surajbisht15 opened 6 months ago

Surajbisht15 commented 6 months ago

How I remove websocket error WebSocket connection to 'ws://localhost:8081/ws' failed.

I am using: Angular 16.x.x Node 16.20.1

Preefix commented 3 months ago

Why is no one taking care of it? Is no one maintaining this lib anymore?

Preefix commented 3 months ago

@Surajbisht15 I fixed it using the https://www.npmjs.com/package/string-replace-loader

You could include the following rule insdie your webpack config file to replace websocket function which generates the error on your client

{ test: /leaflet\.distortableimage\.js$/, use: [{ loader: 'string-replace-loader', options: { search: /var WebSocketClient =.*?(\}\);)/gs, replace: function(match) { return match.replace('this.client = new WebSocket(url);', 'this.client = {};'); }, }, }, ], },

maximbroos commented 1 month ago

Such a pity this wonderful library is not supported anymore. I sadly don't have the skills to fix it, but this bug makes it unusable right now...