Skip to content

NullPointerException with getting started steps #218

@alza-bitz

Description

@alza-bitz

Hi there,

I'm getting a NullPointerException when trying to follow the "getting started" steps here: https://scicloj.github.io/clay/#getting-started

This is in a VSCode dev container with Java 17, running from a directory with no deps.edn or Clojure project, so the classpath is just clay and transitive deps (I presume):

vscode@6755557927fb:/workspaces$ clj -Sdeps "{:deps {org.scicloj/clay {:mvn/version \"2-beta32\"}}}"
Clojure 1.12.0
(require '[scicloj.clay.v2.api :as clay])
nil
(clay/make! {:single-form '(+ 1 2 3)})
Clay serving at http://localhost:1972/
Wed Mar 12 10:51:44 UTC 2025 [http-kit-server-worker-1] ERROR - GET /
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "s" is null
        at clojure.string$replace.invokeStatic(string.clj:101)
        at clojure.string$replace.invoke(string.clj:75)
        at scicloj.clay.v2.server$wrap_html.invokeStatic(server.clj:123)
        at scicloj.clay.v2.server$wrap_html.invoke(server.clj:121)
        at scicloj.clay.v2.server$routes.invokeStatic(server.clj:159)
        at scicloj.clay.v2.server$routes.invoke(server.clj:147)
        at clojure.lang.Var.invoke(Var.java:386)
        at org.httpkit.server$wrap_ring_websocket$ring_handler_STAR___1632.invoke(server.clj:437)
        at org.httpkit.server.HttpHandler.runSync(RingHandler.java:144)
        at org.httpkit.server.HttpHandler.run(RingHandler.java:138)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Execution error (IOException) at sun.net.www.protocol.http.HttpURLConnection/getInputStream0 (HttpURLConnection.java:2037).
Server returned HTTP response code: 500 for URL: http://localhost:1972/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions