Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: object is not a function #54

Closed
ronag opened this issue Jan 2, 2015 · 7 comments
Closed

Uncaught TypeError: object is not a function #54

ronag opened this issue Jan 2, 2015 · 7 comments

Comments

@ronag
Copy link

ronag commented Jan 2, 2015

When running with react-hot-loader I'm getting:

Uncaught TypeError: object is not a function

At the last line of the following:

/* WEBPACK VAR INJECTION */(function(module) {/* REACT HOT LOADER */ if (true) { (function () { var ReactHotAPI = __webpack_require__(9),     RootInstanceProvider = __webpack_require__(4);  if (typeof ReactHotAPI === "function" && typeof RootInstanceProvider === "object") { module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(RootInstanceProvider.getRootInstances); } })(); }

module.exports = function(module) {
    if(!module.webpackPolyfill) {
        module.deprecate = function() {};
        module.paths = [];
        // module.parent = undefined by default
        module.children = [];
        module.webpackPolyfill = 1;
    }
    return module;
}


/* REACT HOT LOADER */ if (true) { (function () { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "module.js" + ": " + err.message); } }); module.hot.dispose(function (data) {   data.makeHot = module.makeHot; }); if (module.exports && module.makeHot) { var freshModuleExports = module.exports; module.exports = module.makeHot(module.exports, "__MODULE_EXPORTS"); for (var key in module.exports) { if (freshModuleExports[key] && freshModuleExports.hasOwnProperty(key)) { module.exports[key] = module.makeHot(freshModuleExports[key], "__MODULE_EXPORTS_" + key); } } } })(); }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)(module)))
@gaearon
Copy link
Owner

gaearon commented Jan 2, 2015

Are you using the latest version? Try 1.0.6.
If it doesn't help, change your config to have exclude: /node_modules, e.g.

{ test: /\.jsx?$/, loaders: ['react-hot', 'jsx?harmony'] , exclude: /node_modules/ },

@gaearon
Copy link
Owner

gaearon commented Jan 2, 2015

Related webpack/webpack#632.

@ronag
Copy link
Author

ronag commented Jan 2, 2015

exclude helped.

@gaearon
Copy link
Owner

gaearon commented Jan 2, 2015

Are you on Windows?

@ronag
Copy link
Author

ronag commented Jan 2, 2015

Correct.

@gaearon
Copy link
Owner

gaearon commented Jan 2, 2015

OK, I know what this is. Thanks.

I have an additional check to guard against this but it uses / as separator.

I'm not sure whether to fix the check, or to remove it altogether and tell everyone to use exclude..

@gaearon
Copy link
Owner

gaearon commented Jan 3, 2015

Fixed in 1.0.7. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants