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

getLoadableState)(...).then is not a function #12

Closed
bnlb opened this issue Aug 8, 2017 · 2 comments
Closed

getLoadableState)(...).then is not a function #12

bnlb opened this issue Aug 8, 2017 · 2 comments

Comments

@bnlb
Copy link
Contributor

bnlb commented Aug 8, 2017

First off, great work! I love the simplicity of this project.

Expected behavior

getLoadableState() should return a promise.

Actual behavior

getLoadableState() returns an instance of DeferredState if no queries are found.

Steps to reproduce

  1. From the root of an empty directory: yarn add loadable-components.
  2. Open node_modules/loadable-components/server/index.js.

getLoadableState contains the following line:
if (!queries.length) return new _DeferredState2.default([]);

If I download the repo and run yarn build, this is output instead:
if (!queries.length) return Promise.resolve(new _DeferredState2.default([]));

Opening up the tarball listed on npm shows the line that isn't wrapped in Promise.resolve, so I think all that needs to be done is to update that.

@gregberge
Copy link
Owner

Thanks! I will fix it soon.

@gregberge
Copy link
Owner

It was already fixed, I published a new version: https://github.com/smooth-code/loadable-components/releases/tag/v0.2.1

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