Closed Bug 1358807 Opened 7 years ago Closed 7 years ago

Relative path no longer working in remoteRequire

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bugzilla, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170413192749

Steps to reproduce:

Upgraded nightly built to 55.0a1 (2017-04-22). CanvasBlocker (https://addons.mozilla.org/de/firefox/addon/canvasblocker/) was installed.


Actual results:

Error in the console and the addon is not working.

More detailed analysis: 
the line in this commit: https://github.com/mozilla/gecko-dev/commit/cbfb61ba923bfd32e22f6e5c57491da7dce03e00#diff-8f7679c8efb4c2fab953a23ce2d5ad02L329
which is a resolution for this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1314861
seems to break the usage of relative paths in remoteRequire.

This call (within the file lib/main.js) does not work: remoteRequire("./frame.js", module);
But this still works:
var framePath = require("sdk/self").data.url("").replace(/data/$/, "") + "lib/frame.js";
remoteRequire(framePath);


Expected results:

No error and the addon should work.
Problem not existing in 55.0a1 (2017-04-15).
Error logs that prove that the relative path is resolved wrong:
console.error:
  Message: Module `sdk/remote/lib/frame.js` is not found at resource://gre/modules/commonjs/sdk/remo
te/lib/frame.js
  Stack:
    @resource://gre/modules/commonjs/sdk/remote/child.js:81:3
emitOnObject@resource://gre/modules/commonjs/sdk/event/core.js:110:7
emit@resource://gre/modules/commonjs/sdk/event/core.js:86:38
messageReceived@resource://gre/modules/commonjs/sdk/remote/child.js:67:37

console.error:
  Message: Module `sdk/remote/lib/frame.js` is not found at resource://gre/modules/commonjs/sdk/remo
te/lib/frame.js
  Stack:
    @resource://gre/modules/commonjs/sdk/remote/child.js:81:3
emitOnObject@resource://gre/modules/commonjs/sdk/event/core.js:110:7
emit@resource://gre/modules/commonjs/sdk/event/core.js:86:38
messageReceived@resource://gre/modules/commonjs/sdk/remote/child.js:67:37
Sorry. It looks like only a handful of add-ons are using this feature, and I don't think that implementing the kind of partial resolution necessary to make this work with the new loader code is worth the effort at this point.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Since there is a workaround I'm OK with the "WONTFIX". But at least change the documentation to reflect the regression. Just a few things are more frustrating than having a documented feature that once worked and then stopped without any notification.
You need to log in before you can comment on or make changes to this bug.