Question

I'm trying to use nested view with DustJS (linkedin fork) with ExpressJS. While rendering the response system generates some escape chars in response. Which disturb the style and theme.

The same code renders fine as one view file, but when split code into two view files (one load as partial) than the problem arise.

Interesting thing is, it happens with two view engines I tried, the same issue, ECT and DustJS. Development on minimal components, Twitter Bootstrap 3.0 and express are additional component added so far.

My machine is running windows as operating system and development tool is visual studio. What could be reasons, has anyone find same trouble with these view engines?

View in Google Chrome Developer Tool. Trace in Developer Tool, additional blank space.

Response-Text View Source

I tried to fiddle and tried to map the extra chars. enter image description here

Was it helpful?

Solution

You have an UTF-8 BOM in one of the files you are using, usually in the first 3 bytes. Normally, a text editor will not show you these characters. Examine your used files with a hex editor (or write a script that examines those files for you) & store the offending file without that UTF-8 BOM, and configure all your editors to omit the BOM in future.

OTHER TIPS

In addition to Wrikken's answer, if you are using Visual studio than it cab be fixed by advance save option.

Advance save option in Visual Studio

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top