I use EJS in my projects, and as it goes, I run into 500 errors every time some aspect of the EJS doesn't load properly--be it that a res.locals variable didn't get passed in, or a file path is wrong in a render() method.
All I receive is a 500 error. No messages, no line numbers, no error type, nothing.
Here is the terminal output when the page doesn't load:
And here's what the browser shows:
On other projects using a different kind of error display page, I've seen some error messages that say "If this isn't helpful, try EJS Lint", so I installed it and look into the "documentation", such as it is, and It has zero information about what to expect from output. I paste in the commands and the path to the file I need to test, and the CLI just sits there, and the API seems to do absolutely nothing.
Here's what I've tried in the CLI:
ejslint /views/owner/dashboard.ejs
And for the API call:
const ejsLint = require('ejs-lint');
ejsLint('../views/partials/addUserForm.ejs', {states, datePoints, beginDate, endDate, recentCompanies, allLocations, recentInvitations, recentForms,totalQuestions, totalCompanies, totalForms, graphDatasets, page:'ownerDashboard'});
Again, no messages. No errors. No output of any sort, at all.
Is there a resource somewhere that explains, step-by-step how to use this tool?
This answer is the closest I could find, and it still says nothing about where any output will show, what it will look like, how it will be formatted, etc: how to use ejs lint in cli
Related
I have taken over an Electron project from another developer.
The problem I am facing is that the project does not show any errors. Even including something like throw "this is an error" does not produce any output on the main process or render process consoles or any sort of standard error popup.
I have checked to confirm that electron-unhandled is not in use and that nothing registers 'uncaughtException'.
What am I missing that could cause this behavior?
Search for: unhandledRejection
unhandledRejection : This will catch any thrown errors, or non fatal errors you have successfully handled via throw.
uncaughtException : This only catches fatal errors or errors that would crash your node instance
WebWorkers : There will be yet another console for webworkers if your using those.
package.json : Take a look in here at the script executed to start electron or however your starting it... Make sure the console is not being sent to a remote console. This feature would allow for debugging the application via Chrome/Firefox vs the standard console. Pretty common for electron apps. If is done via the startup command.
May look something like this:
process.on('unhandledRejection', function (err) {
});
Also, make sure you include any modules in your searching for suppressors as the issue may exist somewhere in the node_modules directory and many IDE's (mine does by default) exclude that directory in indexing/searches.
Another possible reason could be stdout and/or stderr redirection, the problem is this could be achieved by several ways so it's hard to suggest you what to check...
If there is some child_process call to launch a sub-process you could check the stdio array used, or you can check if some low level operation is performed against file descriptors 1 and 2...
Hope this helps.
Are you facing the problem as mentioned in this official thread. You may disable the original event listeners and manage the ELECTRON_BROWSER_WINDOW_ALERT event by my event listener.
Here is the solution
ipcMain.removeAllListeners("ELECTRON_BROWSER_WINDOW_ALERT")
ipcMain.on("ELECTRON_BROWSER_WINDOW_ALERT", (event, message, title)=>{
console.warn(`[Alert] ** ${title} ** ${message}`)
event.returnValue = 0 // **IMPORTANT!**
})
I am new using cloud code of parse.com
I am trying to debug my cloud code, but I can not read the console.log in the terminal. I am using the console of my Mac in this way:
parse deploy
Once the code has update successfully, I curl -X POST the code of the app (the function I want to test) but I can only read the response.success() or the response.error(), all the console.log that I have in the code doesn't appear in the console.
I assume that the log output should appear in the console, but it doesn't.
note for anyone reading, Parse.com is closing down later in 2016 - so don't get too invested in it :O
consider say back4app.com
If you're reading this in the far future .. Parse.com was an ingenious BAAS which ran for a couple years, sensibly sold out to Facebook, and then FB gave up after a couple years. It was basically free to use, so the whole fiasco maybe marks the end of the "amazing stuff, totally free to developers" era.
In your Terminal it's
] parse logs
to see the last few logs.
or if you want to watch everything continuously from the cloud,
they have a command which pipes that output continuously to your terminal:
] parse develop "Your App Name"
So as you, or indeed normal users of your app, uses the Parse app, you can watch "everything that is happening".
(Note too that, once you "turn on" the "parse develop" mode: as well as printing out everything that is happening on the server, additionally: if you locally edit the text files (main.js and so on) in fact, it goes ahead and uploads them to the server, that is to say, just as if you had done a "parse deploy".)
This is a good question -- it's really quite astounding that this is so badly explained everywhere, since, Parse is completely unusable unless you know about these two commands!!
Is there a way to copy all the commands i have written, or to give it some range. Or at least print them out together so i can copy them.
I was trying out jquery selectors in console, after half hour of dealing with very messy dom structure i finally got what i wanted now to transfer that i have to back in history and copy paste every single command. It'd be nice if could log all i have writen, or like last 30 commands etc.
I think it should be possible, as i have seen pretty other advanced abilities of chrome console.
This answer appears to address your question.
Enable logging from the command line using the flags:
--enable-logging --v=1
This logs everything Chrome does internally, but it also logs all the
console.log() messages as well. The log file is called
chrome_debug.log and is located in the User Data Directory.
Filter the log file you get for lines with 'CONSOLE(\d+)'.
via Save the console.log in Chrome to a file
More here on logging. The Chromium Projects: How to enable logging
I'm having an issue where in production only (not development) I get hundreds of cannot read property 'click' of undefined with 3-30 on each click, and a few cannot read property 'submit' of undefined. This very well may not be an issue with Meteor but with my code, so I'm just looking for any ideas why this may be happening or how I can debug it. All my events are either in Template.events or Template.rendered. It happens on every page and no matter where I click.
There are a couple of things that can cause this.
The first is that in production mode latency is a lot higher. So if you've automatically assumed that when a template is rendered the data is ready you could get all sorts of undefined as the object's are null for a very short time when meteor initally loads.
You could check your code to see if you've used any findOne or find. You need to ensure that the result of your query is properly handled in the case that there aren't any results, for that initial load. i.e
var data = myCollection.findOne(...);
if(data) {
....
}
or
var data = myCollection.find(...);
if(data.count()>0) {
....
}
The other thing that might cause it are atmosphere packages that you're using that might not be mapped correctly.
To check this have a look at your network tab in the chrome inspector:
Look through for files whos extensions don't match their content (js & css files).
If a file is a .js file it might have HTML content (Meteor doesn't serve up 404 errors, instead giving them html whichever path is called, so no explicit errors are given).
If this is the case figure out which file it is and map it correctly. (You might be calling click to a plugin that didn't load correctly). In production mode files are minified and the package paths change so this might also be it.
I don't know if this has been asked before, but what i'd like to be able to do is get data from the error console within the browser itself(if it supports it) this would be for when a user sends off a bug report it'd pull up any errors related to pages at my website for things such as typos in code and other things that somehow managed to slip by. Also, in that regard is there a way to pass the errors from the console to a useable format? If this isn't possible, then i could just tell them to copy and paste what came up from the site itself.
I thought of this right now as i was thinking about how to make the bug reporting system run better since the entire thing is basically ran within the browser and for the backend I can easily just look at error logs but for the frontend ie javascript bits of things it's not goign to be as easy.
So to finish wrap all of this up in one little statement, is there an easy way to get the data from the error console and be able to send it along via javascript ie to a form, or something similar.
You can use the onerror event in JS to get the details of the error. Hoptoad do this for example and log the errors to their console, Their code re-uses lots of nice JS scripts including a printStackTrace function that is great.....
You can see how they do it here:
http://hoptoadapp.com/javascripts/notifier.js