I have a questions about importing via require.
With sdk version 1.8, the following worked:
main.js
folder
someFunctionality.js
moreFunctionality.js
utils.js
****
In main.js:
var foo = require("./folder/someFunctionality");
foo.bar(); // etc.
****
In someFunctionality.js:
var utils = require("./utils"); // TypeError: require is not a function
var moreFunctionality = require("./moreFunctionality");
utils.foo(); // etc
moreFunctionality.bar(); //etc
In moreFunctionality.js:
var utils = require("./utils"); // After flattening out directory structure: TypeError: require is not a function
utils.foo(); // etc
****
When I tried to upgrade to 1.9 (and 10 and 11), I got an error in someFunctionality.js that "require" is not a function.
TypeError: require is not a function
I played around a bit, and by flattening out the directory structure, "require" was defined in "someFunctionality", but it was not defined in "moreFunctionality".
Obviously I don't have a good understand of how require is supposed to work. Also I didn't see anything in the 1.9 release notes or the docs that explained what I was doing wrong before such that this stopped working.
Any help would be appreciated
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mozilla-labs-jetpack/-/X5dHkQIIBf0J.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en.