question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improper escaping of path (precompiler issue)

See original GitHub issue

When using the below command to precompile:

  node node_modules\nunjucks\bin\precompile app/views/js/presales > app/storage/assets/compiled/js/presale_templates.js

The output in presale_templates.js:

  (function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["flooring\index.html"] = (function() {function root(env, context, frame, runtime, cb) {

As you can see this is effectively escaping the character ‘i’ "flooring\index.html" which causes issues in loading the template with the render function.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jlongstercommented, Nov 1, 2013

@mattbasta that would fix it, but it seems like that actual template names should always use the forward slash /. That way you always say nunjucks.render("foo/bar.html") and it runs on every platform.

Still, no harm doing the JSON thing too for other edge cases.

0reactions
garygreencommented, Oct 25, 2014

This has been fixed a while ago, closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could someone explain C++ escape character " \ " in relation ...
The solution is to either escape your backslashes, or use raw string literals (C++11 onwards): const char* path = R"(c:\myfolder\file.txt)".
Read more >
visual C++ fatal error c1083: cannot open include file - MSDN
The backslash is not consider an escape character in the path ? Surely you mean only in precompiler directives, right. Doesn't the precompiler ......
Read more >
95253 – [10/11 Regression] Build failure on MSys. Wrong ...
Now I get a dependency check error from make when building mingw-w64 crt due to wrong output escaping in gcc 10.1.0.
Read more >
Why does the error "Precompiling assets failed" appear? #1168
Hello. I suddenly began to receive error when deploy. For several days now I can not understand what's wrong. First I tried to...
Read more >
How we fixed one bug in CMake - PVS-Studio
The problem was that the source file, which used the precompiled header, was not correctly preprocessed if the Clang compiler was used. There ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found