Uncaught ReferenceError: createSelectorCreator is not defined
Hi,
I got Uncaught ReferenceError: createSelectorCreator is not defined when I use "jsnext:main", please help. Thanks.
@agile116 Show your code. And I think you don't use modules correctly.
import reselect from 'reselect';
and
import * as reselect from 'reselect';
are not the same. The first one imports only default export, which is empty object in this case. You can try
import { createSelectorCreator } from 'reselect';
And you can read http://www.2ality.com/2014/09/es6-modules-final.html
@TrySound I'm using import { createSelector } from 'reselect'; It shows the above error in createSelector method.
index.js?2b69:62 Uncaught ReferenceError: createSelectorCreator is not definedcreateSelector @ index.js?2b69:62(anonymous function)
Hi, @agile116, there could be quite a few variables at play here. How are you compiling your code (Webpack, Browserify, Rollup, etc)? Does this error get thrown when you try to compile or is it a runtime error? Any other details about your build process and a more complete example of the code you're using would be very helpful I think.
There's also an issue open regarding the jsnext:main build so that could be related (#103).
Hi npbee, I'm using webpack 2 with mainFields: ["jsnext:main","webpack", "browser", "web", "browserify", ["jam", "main"], "main"]. This is an runtime error, compile seems good. If I remove "jsnext:main", runtime error would be gone.
Hm, took a quick try and I wasn't able to reproduce the error you're seeing, seems to work ok for me. Are you able to provide your full webpack config and a sample of the code you're using? I'm not sure I'll be able to help much more without that.
Hi npbee,
I think your change yesterday may fix the "jsnext:main" issue, is it possible to publish it to npm? Thanks.
Add jsnext build
Add a build step for jsnext:main, compiling all non-ES5 features except for
modules.
@agile116 v2.5.0 published on npm
thanks, I'll try it tomorrow. :)
在 2016年4月21日,下午8:24,Lee Bannard <[email protected]mailto:[email protected]> 写道:
@agile116https://github.com/agile116 v2.5.0 published on npm
― You are receiving this because you were mentioned. Reply to this email directly or view it on GitHubhttps://github.com/reactjs/reselect/issues/114#issuecomment-212892937
It is fixed with the latest version. Thanks. :)