Comments (3)
Currently running into this issue also, from Miso HEAD. Is there a known version that works before this?
Some additional information (don't know if it helps, but might as well):
The console log will report the following after triggering a reload using the config in the comment above:
jsaddle.js:150 POST http://localhost:8080/sync/-631705263071168198 500 (Internal Server Error)
(anonymous) @ jsaddle.js:150
func @ jsaddle.js:151
eval @ VM21:32
VM56:1 Uncaught SyntaxError: Unexpected token S in JSON at position 0
at JSON.parse (<anonymous>)
at jsaddle.js:151
at func (jsaddle.js:151)
at HTMLBodyElement.eval (eval at processBatch (jsaddle.js:84), <anonymous>:32:7)
Which points to xhr.send(JSON.stringify({"tag": "Callback", "contents": [lastResults[0], lastResults[1], nFunction, nFunctionInFunc, nThis, args]}));
, which I think should map to jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs#L152 (since it is between case "NewSyncCallback"
and case "FreeCallback"
).
No big changes has happened in this file in a while, so I doubt that's the root cause.
Looking at the original location in question jsaddle-warp/src/Language/Javascript/JSaddle/WebSockets.hs#L129, the only "recent" changes I can see are the triple equality check added 2 months ago (50950b5) and a fix to use two websockets to support macOS 11 months ago (e6ba1fc).
This leads me to suspect that it's not a bug introduced in JSAddle necessarily, but maybe GHCJS or the browser changed, and it has to be accommodated?
from jsaddle.
Did any of you manage to work around this since this bug was filed?
from jsaddle.
I worked around this issue using entr to watch file changes, to trigger reloading the midori browser (a midori tab can reloaded from the command line):
#!/usr/bin/bash
# Install entr if missing
which entr || sudo apt install entr
# Install midori if missing
which midori || sudo snap install midori
function midori_listen() {
# That's the whole point of this script. It listens to changes to all versioned .hs files:
# and pings midori
git ls-files "*.hs" | entr -s "midori -p -e tab-reload"
}
midori_listen &
# Start midori if not yet there:
[[ $(pgrep midori) == "0" ]] || (midori "http://localhost:8080" &)
# Regenerate js upon .hs saving, usual miso business:
nix-shell --run reload
from jsaddle.
Related Issues (20)
- jsaddle-warp: stopPropagation sometimes doesn't work HOT 2
- Static files HOT 1
- Support GHC-8.8 HOT 1
- SPA routing HOT 4
- Using WebSockets with JSADDLE
- Maybe bump warp dep of jsaddle-warp on hackage HOT 1
- How to get result of promise/async function without a continuation Haskell function.
- Lots of ambiguous type errors when using OverloadedStrings
- TypedArray sliceIO is not exported
- Too strict version bound on ref-tf HOT 1
- How to run tests? `cannot satisfy -package lens-5.1` HOT 2
- jsaddle-warp restarts periodically
- jsaddle-warp performance with massive arrays (length == 518400)
- CC constructor type mismatch when using text-2.0.1 HOT 2
- Re-release jsaddle on Stackage HOT 1
- JSaddle for GHC Javascript Backend HOT 2
- How to use `jsaddle-clib` HOT 8
- jsaddle-webkit2gtk: "Not allowed to load local resource" HOT 3
- jsaddle-warp browser DOS on the Haskell program (stuck on sendTextData) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsaddle.