Formik cannot be built from source
See original GitHub issueBug, Feature, or Question?
I’m trying to include Formik in my bundle with Webpack. However, Formik appears to bundle prop-types
, invariant
, warning
, and a few lodash modules, even if they are present in my bundle. Is this by design? I don’t want to ship multiple copies of these shared libraries.
Current Behavior
Formik bundles certain required libraries
Desired Behavior
Formik requires these libraries as dependencies rather than bundling directly
Suggested Solutions
Publish src
so that Formik can be built from source.
Additional Information
Formik is great, and I really like using it 😃
- Formik Version: 0.11.11
- React Version: 15.3
- TypeScript Version: n/a
- CodeSandbox Link: n/a
- OS: OSX 10.12.6
- Node Version: 8.10
- Package Manager and Version: npm@5.6
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TypeScript - Formik
The Formik source code is written in TypeScript, so you can rest easy that Formik's types will always be up-to-date. As a mental...
Read more >Can't resolve react in formik/dist - custom webpack config
yarn add formik or npm install --save formik worked for me.
Read more >Building forms with Formik in React - LogRocket Blog
Formik is definitely one of those open source libraries that's a must-have if you are writing many forms in your React application. It...
Read more >Upgrading Formik from v1 to v2 - Level Up Coding
Formik is the most popular open-source form library for React and React Native that ... Formik version 2 is built on top of...
Read more >React Form Validation With Formik And Yup
In this article, we'll learn how Formik handles the state of the form data ... [^\s@]{2,}$/i; if (!values.email) { errors.email = "Cannot be ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually, I haven’t noticed it until this PR came - https://github.com/jaredpalmer/formik/pull/513, when creating ESM or CJS bundles, I believe they should not include any external dependencies, because bundlers can handle that.
There is a comment from @Andarist https://github.com/rollup/rollup/issues/1847#issuecomment-356644324 and also his blog post - https://developers.livechatinc.com/blog/how-to-create-javascript-libraries-in-2018-part-2/
I cut a release with the new build setup. Try
formik@next
orformik@1.0.0-alpha.3