@@ -24,18 +24,30 @@ sandwich moduleName javascript =
2424<head>
2525 <meta charset="UTF-8">
2626 <title>|] <> name <> [r|</title>
27+ <style>body { padding: 0; margin: 0; }</style>
2728</head>
2829
2930<body>
30−<div id="elm-df98db9626"></div>
31+
32+<pre id="elm">
33+This is a headless program, meaning there is nothing to show here.
34+
35+I started the program anyway though!
36+
37+You can access it as `app` in the developer console.
38+</pre>
39+
3140<script>
3241|] <> javascript <> [r|
3342
34−var app = Elm.|] <> name <> [r|.init({ node: document.getElementById("elm-df98db9626") });
35−if (document.getElementById("elm-df98db9626"))
36−{
37− document.getElementById("elm-df98db9626").innerText = 'This is a headless program, meaning there is nothing to show here.\n\nI started the program anyway though, and you can access it as `app` in the developer console.';
43+try {
44+ var app = Elm.|] <> name <> [r|.init({ node: document.getElementById("elm") });
45+} catch (e) {
46+ // display initialization errors (e.g. bad flags, infinite recursion)
47+ document.getElementById("elm").innerText = e;
48+ throw e;
3849}
3950</script>
51+
4052</body>
4153</html>|]