pjlast / fsocaml Goto Github PK
View Code? Open in Web Editor NEWTemplate repository for a full-stack OCaml web app
Template repository for a full-stack OCaml web app
I've done a complete redo from scratch now with the latest checkout of the repo, but the following problem persists. After making the final change in the tutorial (adding the middleware), an attempt to click through to the application gives the following result in the browser:
Failure("Missing session middleware")
Raised at Stdlib__Map.Make.find in file "map.ml", line 141, characters 10-25
Called from Logs.Tag.find in file "src/logs.ml", line 154, characters 14-32
From: Application
Blame: Server
Severity: Error
Client: 127.0.0.1:44118
GET /
Host: localhost:8080
Connection: keep-alive
sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Brave";v="120"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8
Sec-GPC: 1
Accept-Language: en-GB,en
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Cookie: dream.session=ACSQoiUvZVrpCm5O8S9z5EObC8kD-LFMoB3-xu0mXxLmnf0HnpZGIiYudaZ4hz0S00i53OqQq5cbsye1v6uDiOfnZ3UVVFx1CnFDwQ9owQtj31QuNn3Hk_tVR1wXttGsJtsT1fdn6kyu8FQX6kzoe6AcqvOvceylkLr7IOko2h1AkoTF5xNGemir8fw6qrgpKL06J5xK2UhWU6zkUG4QPYf3tI2KxWxvBjYpBi8
dream.secret: [redacted]
dream.client: 127.0.0.1:44118
dream.tls: false
dream.request_id: 1
dream.params:
The following is the output of the server console:
19.12.23 06:19:23.823 dream.log INFO REQ 1 GET / 127.0.0.1:35788 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
19.12.23 06:19:23.824 dream.session ERROR REQ 1 Missing session middleware
19.12.23 06:19:23.824 dream.log WARN REQ 1 Aborted by: Failure("Missing session middleware")
19.12.23 06:19:23.824 dream.log WARN Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
19.12.23 06:19:23.824 dream.log WARN Called from Dream__server__Session.typed_middleware in file "src/server/session.ml" (inlined), line 46, characters 13-25
19.12.23 06:19:23.824 dream.log WARN Called from Dream__server__Session.session in file "src/server/session.ml", line 335, characters 29-45
19.12.23 06:19:23.824 dream.log WARN Called from Dream.session_field in file "src/dream.ml" (inlined), line 257, characters 33-53
19.12.23 06:19:23.824 dream.log WARN Called from Middleware.user_middleware in file "lib/middleware/middleware.ml", line 25, characters 8-39
19.12.23 06:19:23.824 dream.log WARN Called from Lwt.Sequence_associated_storage.with_value in file "src/core/lwt.ml", line 804, characters 19-23
19.12.23 06:19:23.824 dream.log WARN Re-raised at Lwt.Sequence_associated_storage.with_value in file "src/core/lwt.ml", line 809, characters 6-15
19.12.23 06:19:23.824 dream.log WARN Called from Lwt.Sequential_composition.try_bind in file "src/core/lwt.ml", line 2139, characters 10-14
19.12.23 06:19:23.824 dream.http ERROR REQ 1 Failure("Missing session middleware")
19.12.23 06:19:23.824 dream.http ERROR REQ 1 Raised at Stdlib__Map.Make.find in file "map.ml", line 141, characters 10-25
19.12.23 06:19:23.824 dream.http ERROR REQ 1 Called from Logs.Tag.find in file "src/logs.ml", line 154, characters 14-32
The only reference to this error message online is in the context of csrf tokens where a request was not generated within the context of the session handler.
Thanks for pulling this together. I think this going to be a boon for helping newbies like me trim the decision fatigue for making useful web projects.
I think that this opam pin needs to be "git+https://". At least that was the change required on my system.
Line 37 in a1d99e1
I tried this originally on 4.14 and fixed it with git+https://. Then realized I'd rather be on 5.1.0 and removed my switch and reran opam install . --deps-only
, (without the "git+" prefix). This worked as expected. So I'm not sure if the prefix was necessary or not, but all docs seem to suggest it should be there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.