Open samholmes opened 11 years ago
require.define("parts/jewels/chat-message.jade",Function(['require','module','exports','__dirname','__filename','process'],"module.exports = function anonymous(locals, attrs, escape, rethrow, merge) {\nattrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\nvar buf = [];\nwith (locals || {}) {\nvar interp;\nbuf.push('<li><span class=\"thumbnail profile-photo\"><img');\nbuf.push(attrs({ 'src':('/profile/' + (message.senderId) + '/photo') }, {\"src\":true}));\nbuf.push('/></span><div class=\"details\"><div class=\"message\">');\nvar __val__ = message.message\nbuf.push(escape(null == __val__ ? \"\" : __val__));\nbuf.push('</div><span');\nbuf.push(attrs({ 'data-ms':(new Date(message.tsCreated).getTime()), \"class\": ('timestamp') }, {\"data-ms\":true}));\nbuf.push('></span>');\nif ( (message.classifiedId))\n{\nbuf.push('<div class=\"regarding\">Re: <a');\nbuf.push(attrs({ 'href':(\"/classified/\" + (message.classifiedId) + \"\"= message.classifiedTitle) }, {\"href\":true}));\nbuf.push('></a></div>');\n}\nbuf.push('</div></li>');\n}\nreturn buf.join(\"\");\n}\n//@ sourceURL=parts/jewels/chat-message.jade"
));
I found that this is the code that give me this error. Anyone see anything wrong with that? :P
I figured out that the issue was coming from this line in my Jade file:
a(href="/classified/#{message.classifiedId}"= message.classifiedTitle)
Which is an error. It should have been
a(href="/classified/#{message.classifiedId}")= message.classifiedTitle
Now, this took a lot of time for me to debug because I needed to set a breakpoint on uncaught exceptions and then dig through the line of code through trial an error. It was tedious. There has to be a better way to report syntax errors in my templates. In Express, when you try to access a template that has an error, it gives you a pretty extensive report on the error that is very helpful. Sense this isn't express, it's the browser, is there a way to replicate this good error reporting for the browserijade lib?
I'm not too familiar with how browserijade works, let alone Jade, Express or Browserify. However, I'm getting the hang of it. Let me know how error reporting could be done, or why it could not be possible in browserijade.
Hey there Sam. I haven't been able to do much Node.js programming lately, so this might take a little while to fix unless you're able to help me out.
First off, Browserify has a --dev
flag that enables sourceURLs in the bundle. If you enable sourceURLs in Webkit dev tools or Firebug you should get far more debuggable files.
It does seem a little strange that Jade doesn't give you an error on build though. It might just be really hard to catch without running it.
As of right now there is no browser testing which is bad. Testling CI should be hooked up so we can see exactly what browsers the tests are passing in at any time.
I seem to be running into a Safari exception with my project. I'm having trouble pin-pointing exactly where the exception is coming from, but it appears to be in my browserify bundle and specifically a browserijade template. I'm wondering if it could possibly be something wrong in my jade template or in browserijade itself (it's hard to tell because jade templates are literally compiled down to one line of code, so it's beyond me as to how to debug this issue).
If it were my jade template, then I would see this exception not exclusively in Safari. The exception, specifically, is
SyntaxError: Expected token ')'
.Maybe there's a way to turn on a debugging mode for browserijade, so that the templates aren't compiled down to one line of code. This would give me better debugging information for the exception.
However, the question remains, how much testing has been put into this library? What browsers and versions have been tested?