Leaflet.DistortableImage: WebSocket connection to 'ws://localhost:8081/ws' failed
Describe the bug:
Whenever a page that has this package included is opened, the browser repeatedly attempts to connect to the WebPack dev server at localhost:8081. As I’m not using WebPack, this request constantly fails and it also happens in production. When you open your browser’s dev tools, you can observe this behavior in the console. This also happens on the demo site.

It looks like the package is distributed with a development build, but I haven’t looked too far into it. I’m not that familiar with WebPack.
Reproduce the behavior:
- Open any site running this plugin, e.g. https://publiclab.github.io/Leaflet.DistortableImage/examples/index.html
- Open your browser’s dev tools
- Observe the console for connection errors
Browser, version, and operating system:
- Happens in all browsers (tested with Chrome, Firefox, and Safari)
- Versions 108.0.5359.98, 108.0.1, and 16.1 (18614.2.9.1.12) respectively
- Platform: macOS Ventura
Any help is much appreciated, thanks a lot in advance! 😃
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 7
- Comments: 16
looks like the only way to fix that is to clone repository locally and make the production build with “npm run build” (I had to disable tests also in gruntfile, they didn’t start). When files can be copied into your project from ‘dist’ folder instead of using NPM package. But keep in mind the latest version of the code in the repository has at least two bugs:
If you don’t want to do it yourself, just take from ‘dist’ folder in this fork https://github.com/Karelics/Leaflet.DistortableImage
P.S. maintainers (@jywarren ?) some unexplainable hell is happening with the repository, development build released into NPM, unstable updates merged into main branch, so new release can’t be done without adjestments, … In general your library looks so cool, but what happened in the last year, could you stabilize the situation, thank you!
Im still having the same issue with 0.21.10 working with NextJS v13.
Looks like it is not working with websocket builds, can someone have a work around for it.
I got the same issue with the latest release. This package worked for me: https://www.npmjs.com/package/leaflet-distortableimage-updated Be sure to include leaflet-toolbar