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

In 6.0.3 flow types for enableAllPlugins() etc. don't exist in index.js.flow #570

Closed
watanas opened this issue Apr 2, 2020 · 5 comments
Closed
Labels

Comments

@watanas
Copy link
Contributor

watanas commented Apr 2, 2020

🐛 Bug Report

Starting with immer@6.0.3, flow reports an error when trying to import the immer functions from
https://immerjs.github.io/immer/docs/installation#pick-your-immer-version

To Reproduce

Minimal test file:

// @flow
import {enableAllPlugins} from 'immer';
enableAllPlugins();

Then run flow type checking.

Observed behavior

Flow reports the error:

Cannot import enableAllPlugins because there is no enableAllPlugins export in immer.

Expected behavior

No flow errors.

Environment

  • immer@6.0.3
  • flow
@mweststrate
Copy link
Collaborator

mweststrate commented Apr 2, 2020 via email

@esturcke
Copy link
Contributor

esturcke commented Apr 7, 2020

I suspect this is showing up in 6.0.3 because flow is now actually using the type definitions from this change. Before that flow would treat enableAllPlugins as having an any type.

@esturcke
Copy link
Contributor

esturcke commented Apr 7, 2020

@watanas do you want to put a pull request for this together. I just ran into this as well and would love to get updated flow types in. If not, I'd be happy to work on it.

@watanas
Copy link
Contributor Author

watanas commented Apr 7, 2020

@esturcke Added a pull request for this issue. PTAL. Thanks!

@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 6.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

4 participants