Based on the answer from @shanzilla, you likely need to wait until everything is loaded—including your Fabric.js module and any drawing you may be doing—before trying to check if something exists. Not sure on how you're loading the Fabric.js code or when you're drawing the canvas, but a quick & dirty way to check if this is the issue is to wrap that log in a timeout:
setTimeout(function () {
var objects = wpd_editor.canvas.getObjects();
console.log(objects[0]);
}, 1000)
This is likely not a sustainable solution for you, but it will let you know that, in that one second that you're waiting, some crucial things are happening, specifically the loading and rendering of the page. For a more sustainable solution, something like the following, which uses Fabric.js's events API to wait for the canvas to be rendered, would probably work:
wpd_editor.canvas.on('after:render', function() {
var objects = wpd_editor.canvas.getObjects();
console.log(objects[0]);
});
console.log(objects)log?console.log(objects['u'])