Stack trace missing in terminal

RESOLVED FIXED

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: mirza+mozillia, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713224758

Steps to reproduce:

Executed 'cfx run' with these files.

/* main.js file */

var pageMod = require("page-mod");
var self = require('self');

pageMod.PageMod({
	include: '*.com',
	contentScriptFile: [
		self.data.url('index.js'),
	]
});



/* data/index.js */

setTimeout(function() { console.log(notDefinedVariable); }, 1000);



Actual results:

When the content script is injected into a page and the timeout fires, I get the following log in my terminal and firefox error console.

error: An exception occurred.
Traceback (most recent call last):
[object Object]


Expected results:

Instead of [object Object] there should be a stack trace with the 'notDefinedVariable is not defined' message. When executing the following content script, I get the expected stack trace.

/* data/index.js */

console.log(notDefinedVariable);

Updated

5 years ago
Priority: -- → P1

Comment 1

4 years ago
I have the same issue. This is still not fixed and makes it nigh impossible to find the code throwing the exception.
There is also no additional output on Error Console or Firebug Console and I have not been able to find the offending code with venkman.

Comment 2

4 years ago
I have this issue as well. The following is the full output in both the terminal and Error Console in browser.

error: test-project: An exception occurred.
[object Object]
Traceback (most recent call last):

Comment 3

4 years ago
I have run into this issue multiple times now. Usually I have to spray console.log statements all over my code to find out in which file the exception occurred and then where in that file.

A lot of the time it is resolving an unknown symbol (like hello.world where hello = undefined). But I guess it could be any kind of exception.
With all changes were made to console and stacktrace, I think this bug can be closed as fixed: running the code proposed as example, I obtain:

console.error: test: 
  Message: ReferenceError: notDefinedVariable is not defined
  Stack:
    @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///var/folders/tx/91xwh51562l5_4xcqjst9bvw0000gn/T/tmpPd1SJ5.mozrunner/extensions/jid1-V1kRlbNFgAbB0g@jetpack.xpi!/bootstrap.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/toolkit/loader.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/loader/sandbox.js -> resource://jid1-v1krlbnfgabb0g-at-jetpack/test/data/index.js:1:25
onFire@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///var/folders/tx/91xwh51562l5_4xcqjst9bvw0000gn/T/tmpPd1SJ5.mozrunner/extensions/jid1-V1kRlbNFgAbB0g@jetpack.xpi!/bootstrap.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/toolkit/loader.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/loader/sandbox.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/content/content-worker.js:153:11
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.