question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Formik cannot be built from source

See original GitHub issue

Bug, 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
prichodkocommented, Mar 14, 2018

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/

0reactions
jaredpalmercommented, Mar 14, 2018

I cut a release with the new build setup. Try formik@next or formik@1.0.0-alpha.3

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found