df-rw / ob-app

General purpose web application with Observable Framework.
MIT License
0 stars 1 forks source link

Production sample fails on Safari #4

Open angrytongan opened 2 months ago

angrytongan commented 2 months ago
npm run build
go run ./cmd/web/*.go -p 4321
# try and load index.md with safari

One of the warm files doesn't download:

[Error] Failed to load resource: The network connection was lost. (duckdb-eh.wasm, line 0)
[Error] Failed to load resource: The network connection was lost. (duckdb-eh.wasm, line 0)
[Error] Unhandled Promise Rejection: TypeError: TypeError: Load failed

Safari has trouble downloading (certain / large / ?) files from http.Fileserver?

angrytongan commented 2 months ago

This works (for the frontend application), so looks like a Go / http.Fileserver thing:

python3 -m http.server --directory ./dist
angrytongan commented 2 months ago

wget has to retry, so looks like a Go thing:

wget http://localhost:4321/_npm/@duckdb/duckdb-wasm@1.28.0/dist/duckdb-eh.wasm
--2024-08-21 19:51:18--  http://localhost:4321/_npm/@duckdb/duckdb-wasm@1.28.0/dist/duckdb-eh.wasm
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:4321... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18105915 (17M) [application/wasm]
Saving to: ‘duckdb-eh.wasm.2’

duckdb-eh.wasm.2               25%[===========>                                    ]   4.44M  --.-KB/s    in 0.007s

2024-08-21 19:51:18 (666 MB/s) - Connection closed at byte 4660528. Retrying.

--2024-08-21 19:51:19--  (try: 2)  http://localhost:4321/_npm/@duckdb/duckdb-wasm@1.28.0/dist/duckdb-eh.wasm
Connecting to localhost (localhost)|::1|:4321... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 18105915 (17M), 13445387 (13M) remaining [application/wasm]
Saving to: ‘duckdb-eh.wasm.2’

duckdb-eh.wasm.2               58%[++++++++++++==============>                     ]  10.03M  --.-KB/s    in 0.007s

2024-08-21 19:51:19 (759 MB/s) - Connection closed at byte 10520608. Retrying.

--2024-08-21 19:51:21--  (try: 3)  http://localhost:4321/_npm/@duckdb/duckdb-wasm@1.28.0/dist/duckdb-eh.wasm
Connecting to localhost (localhost)|::1|:4321... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 18105915 (17M), 7585307 (7.2M) remaining [application/wasm]
Saving to: ‘duckdb-eh.wasm.2’

duckdb-eh.wasm.2              100%[+++++++++++++++++++++++++++====================>]  17.27M  --.-KB/s    in 0.01s

2024-08-21 19:51:21 (718 MB/s) - ‘duckdb-eh.wasm.2’ saved [18105915/18105915]
df-rw commented 2 months ago

Tested locally on an M2 and it's fine 🤷