refresh not working at all / polyfill.js.map: System error: net::ERR_FILE_NOT_FOUND
I'm running Debian unstable and tried to play with the 0.0.13 binary build for linux-amd64.
The problem is that the "watch" mode simply doesn't work. It renders the content of the d2 file at start-up once, but then the browser never shows any updated image while you edit + save the d2 file.
18:02:29 [success] listening on http://127.0.0.1:40637
18:02:29 [info] compiling /tmp/test.d2...
18:02:29 [success] successfully compiled /tmp/test.d2 to /tmp/test.svg
18:02:29 [info] broadcasting update to 0 clients
18:02:30 [success] GET / 200 385B 16.311µs
18:02:30 [success] GET /static/watch.js 200 1,967B 639.059µs
18:02:30 [success] GET /static/watch.css 200 207B 45.776µs
18:02:30 [success] GET /watch 101 0B 124.383µs
18:02:30 [success] GET /favicon.ico 200 385B 23.805µs
18:02:40 [info] detected change in /tmp/test.d2: recompiling...
so as you can see, d2 claims it is recompiling, but the browser (chromium here) still shows the old image. Even a ctrl+r reload doesn't change: the image is stil the old one. d2 logs a GET though:
18:02:43 [success] GET / 200 385B 15.535µs
18:02:43 [success] GET /static/watch.js 200 1,967B 24.516µs
18:02:43 [success] GET /static/watch.css 200 207B 27.402µs
18:02:44 [success] GET /watch 101 0B 84.898µs
18:02:44 [success] GET /favicon.ico 200 385B 11.497µs
but even after that, the browser continues to show the rendering of the state of first starting d2, not the state of the current edited .d2 file.
Environment:
- debian unstable with all current updates
- chromium browser
- d2-v0.0.13
The developer console of chromium shows:
watch websocket opened
DevTools failed to load source map: Could not load content for chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/browser-polyfill.js.map: System error: net::ERR_FILE_NOT_FOUND
```
Does this mean you are requiring installation of a certain chrome extension?
no, there is no required chrome extension. You can see the whole Javascript stuff here: https://github.com/terrastruct/d2/blob/master/cmd/d2/static/watch.js . Very straightforward websocket listen.
Is the SVG changing? I.e. if you inspect it some other way than the browser, can you see its contents differ from edit to edit in watch mode? Trying to see if it's an issue with saving the file or reloading the file in the browser.
Having the same problem. I'm using Ubuntu on WSL2. It looks as though the SVG is not changing. I've installed using both the install shell script and using go install.