(Windows) Pollen server throws exception when linking to / #270

Open
opened 2 years ago by joel · 1 comments
joel commented 2 years ago

On Windows 10, running the Pollen server in a project folder with this template:

<!DOCTYPE html>
<html lang="en">
<title>Test</title>

◊(->html doc)

<p><a href="/">Home</a></p>

</html>

Clicking the “Home” link results in an exception (below).

(On Mac OS, this navigates to index.html as expected. Not sure if this is a bug in Pollen, a bug in the Racket web server, or just unexpected but logically consequential behavior due to Windows path behavior.)

Obvious workaround is to link to /index.html explicitly.

The application raised an exception with the message:

bytes->path: byte string is empty
Stack trace:

file://->path at:
  line 358, column 0, in file C:\Program Files\Racket\collects\net\url-string.rkt
<unknown procedure> at:
  line 489, column 18, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-val-first.rkt
req->path at:
  line 283, column 0, in file C:\Users\joeld\AppData\Roaming\Racket\8.7\pkgs\pollen\pollen\private\project-server-routes.rkt
<unknown procedure> at:
  line 379, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt
route-index at:
  line 298, column 0, in file C:\Users\joeld\AppData\Roaming\Racket\8.7\pkgs\pollen\pollen\private\project-server-routes.rkt
<unknown procedure> at:
  line 375, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt
<unknown procedure> at:
  line 375, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt
<unknown procedure> at:
  line 63, column 2, in file C:\Program Files\Racket\share\pkgs\web-server-lib\web-server\dispatchers\dispatch-servlets.rkt
<unknown procedure> at:
  line 141, column 2, in file C:\Program Files\Racket\share\pkgs\web-server-lib\web-server\private\dispatch-server-with-connect-unit.rkt
On Windows 10, running the Pollen server in a project folder with this template: ``` <!DOCTYPE html> <html lang="en"> <title>Test</title> ◊(->html doc) <p><a href="/">Home</a></p> </html> ``` Clicking the “Home” link results in an exception (below). (On Mac OS, this navigates to `index.html` as expected. Not sure if this is a bug in Pollen, a bug in the Racket web server, or just unexpected but logically consequential behavior due to Windows path behavior.) Obvious workaround is to link to `/index.html` explicitly. ``` The application raised an exception with the message: bytes->path: byte string is empty Stack trace: file://->path at: line 358, column 0, in file C:\Program Files\Racket\collects\net\url-string.rkt <unknown procedure> at: line 489, column 18, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-val-first.rkt req->path at: line 283, column 0, in file C:\Users\joeld\AppData\Roaming\Racket\8.7\pkgs\pollen\pollen\private\project-server-routes.rkt <unknown procedure> at: line 379, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt route-index at: line 298, column 0, in file C:\Users\joeld\AppData\Roaming\Racket\8.7\pkgs\pollen\pollen\private\project-server-routes.rkt <unknown procedure> at: line 375, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt <unknown procedure> at: line 375, column 33, in file C:\Program Files\Racket\collects\racket\contract\private\arrow-higher-order.rkt <unknown procedure> at: line 63, column 2, in file C:\Program Files\Racket\share\pkgs\web-server-lib\web-server\dispatchers\dispatch-servlets.rkt <unknown procedure> at: line 141, column 2, in file C:\Program Files\Racket\share\pkgs\web-server-lib\web-server\private\dispatch-server-with-connect-unit.rkt ```
Owner

So the error is arising from net/url-string? Maybe the project server should be setting path-convention-type to 'unix, somehow?

So the error is arising from `net/url-string`? Maybe the project server should be setting [`path-convention-type`](https://docs.racket-lang.org/reference/Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-convention-type%29%29) to `'unix`, somehow?
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#270
Loading…
There is no content yet.