Improper escaping of path (precompiler issue)
See original GitHub issueWhen 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:
- Created 10 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mattbasta that would fix it, but it seems like that actual template names should always use the forward slash
/
. That way you always saynunjucks.render("foo/bar.html")
and it runs on every platform.Still, no harm doing the JSON thing too for other edge cases.
This has been fixed a while ago, closing