-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML report missing jquery code #127
Comments
The ghc and cabal-install programs on the two machines are installed from the same binary packages. |
Hm, can you upload the HTML report that has improperly working JavaScript on it? I've been noticing similar things (with But it's also possible that this is something else entirely—I'd need to take a closer look to be sure. |
Bad one is here: http://www.mega-nerd.com/erikd/bench-bad.html |
As I feared, this is #65 once again showing up, as indicated by all the FWIW, on my project ( Do you get this error often when you run it? If so, and you're willing to share the code, it might help me diagnose the issue faster, since this is much closer to a Heisenbug on my machine/project. |
Code is at https://github.com/erikd/fastpack . On some machines I get this every run, on others only occasionally. |
Ok, this seems to be related with whether |
Bah, figured it out and nothing to do with I sometimes use a custom template and the terms in the default templates that are replaced had changed.
Would be nice if there was an actual error or warning printed when the template replacement failed. |
I must admit that I'm terribly confused as to how this pertains to the reported issue. Firstly, are you still talking about your custom template producing HTML that lacks jQuery code, or did you mean to comment on #126 instead (your phrase "template replacement failed" in #127 (comment) leads me to think possibly the latter). I'd also like a clarification on how to reproduce this. I noticed in
Is the |
Seems I should avoid writing bug reports late in the evenings and early in the mornings :/. Seems I managed to confuse myself as well as you. Yes, |
Aha! If I go to commit a75e9ff3b055737194cc08694e4036c30fe3956e of Back to the original question of error messages: I'm not sure if there's much that I think if we wanted better warnings, we'd probably need to switch from |
Agreed! |
lookupKey :: Key -> Render Value
lookupKey (Key []) = NE.head <$> asks rcContext
lookupKey k = do
v <- asks rcContext
p <- asks rcPrefix
pname <- asks (templateActual . rcTemplate)
let f x = asum (simpleLookup False (x <> k) <$> v)
case asum (fmap (f . Key) . reverse . tails $ unKey p) of
-- Context Misses: Failed context lookups should be considered falsey.
-- throw (MustacheRenderException pname (p <> k))
Nothing -> return (String "")
Just r -> return r Notice that the line which would normally throw an exception is commented out. @phadej, is there a reason for doing this? The |
@RyanGlScott it's to adhere to Not sure, if the same |
amendment to the previous: "silent missing variables" are per spec: https://github.com/mustache/spec/blob/83b0721610a4e11832e83df19c73ace3289972b9/specs/interpolation.yml#L106-L110 So it's mustache to blame, I'm open to suggestions though. We can introduce an option(s) to make interpolations more strict. What mustache libraries in other languages do? |
The |
that's a nice idea; the rendered monad is already a state, so adding the warnings shouldn't be too difficult. Could you open issue, i already switched the context; so might take some time until I get to it. |
I've opened haskellari/microstache#3 for this feature request. |
See #152 for an attempt to make warnings more explicit. |
I have two very similar machines (both x86_64, running Debian Testing) and I build the same project on the two machines, with a constraint
criterion == 1.1.1.0
(see #126).When I run the benchmark on both machines, one produces a properly working HTML report and the other produces a HTML page with nothing but a blank line where the jquery/javascript should be.
I can't figure out what is different on the two machines.
The text was updated successfully, but these errors were encountered: