You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use requireJS in the CommonJS style and add a method the exports parameter it provides, Webstorm will not be able to resolve that method if you attempt to use it elsewhere. However, this problem does not occur if you use module.exports instead of just exports.
Example
// JustExports.js
define(function(require, exports) {
exports.someMethod = function() {};
});
// ModuleDotExports.js
define(function(require, exports, module) {
module.exports.someMethod = function() {};
});
// UseExports.js
define(function(require) {
var JustExports = require('JustExports');
var ModuleDotExports = require('ModuleDotExports');
// If you mouse over `someMethod` here, Webstorm shows the warning
// "Unresolved function or method someMethod()"
JustExports.someMethod();
// If you hold down the Cmd key and mouse over `someMethod` here, Webstorm turns the
// cursor into a pointer and tells you where the method lives. If you click on it,
// Webstorm will take you to the method definition.
ModuleDotExports.someMethod();
});
Example from real life project
The text was updated successfully, but these errors were encountered:
Description
If you use requireJS in the CommonJS style and add a method the
exports
parameter it provides, Webstorm will not be able to resolve that method if you attempt to use it elsewhere. However, this problem does not occur if you usemodule.exports
instead of justexports
.Example
Example from real life project
The text was updated successfully, but these errors were encountered: