With formik beta-3, got an error like this one :
/frontend/node_modules/formik/dist/connect.d.ts
(3,59): Cannot find module '../node_modules/create-react-context/lib/index'.
/frontend/node_modules/formik/dist/connect.d.ts
(3,189): Cannot find module '../node_modules/create-react-context/lib/index'.
Can you put together a code sandbox?
I can't reproduce on sandbox :(
https://codesandbox.io/s/pkqqm3yn80
You can see my current project here : https://github.com/CuistotduCoin/cuistot/tree/master/frontend
I never saw a bug like this. I'm going back to 0.11.11 temporarily.
Just tested 1.0.0-beta.4 in CodeSandbox. Seems fine. Perhaps nuke your node_modules and reinstall?
Reference 1.0.0-beta.4 sandbox here: https://codesandbox.io/s/pwo999nrqx
Going to close for now. If anyone else finds this will reopen.
/projects/demo/node_modules/formik/dist/connect.d.ts
(3,59): Cannot find module '../node_modules/create-react-context/lib/index'.
Same issue here with beta 4. Deleted the node_modules as suggested and did a reinstall.
Switching back to 0.11.11 solved it.
What version of React, node, and TS were you using?
Application is bootstrapped with Facebook's create-react-app.
node -v
npm -v
npm list --depth 0
I run into the same error.
2.9.29.11.1Yarn: 1.6.0
React: 16.4.1
1.0.0-beta.4ran into the same issue.

I can fix it by removing ../node_module/, but I found the connect.d.ts is auto-generated by typescript... So, maybe manually generate the d.ts file could solve this?
back to 0.11.11 version now.
Hrmmm. Let me bump to TS 2.9.2 on master and see if i can reproduce?
Maybe this has to do with imported types?
It seems this is a typescript bug.
See https://github.com/Microsoft/TypeScript/issues/25511
Version 3.0 drops very soon. Hopefully, this fixes this bug.
Try 1.0.0-beta.8. This should be fixed now.
Fixed for me.
I'm getting the same error.
node_modules/formik/dist/connect.d.ts
(3,66): Cannot find module 'create-react-context'.
Using [email protected], [email protected].
@vladshcherbin I had the same issue. Formik is compiled to ES5 (target ES5) which means that you have to set "moduleResolution": "Node", it helped for me. For more information read https://www.typescriptlang.org/docs/handbook/compiler-options.html.
@mSpolsky what are you using to build? create react app?
@jaredpalmer No, I am using tsc. Actually, it took me quite some time to find the source of the problem. In the end, it turned out that version 1.3.2 is not working for some other reason related to incorrect typedefs. I had to downgrade to make it work.
what version of TS are you using @mSpolsky ? There is one that broke Formik.
Also getting this issue currently.
Node 10.1.0
React 16.7.0
Typescript 3.2.2
Formik 1.4.2
If I add create-react-context to my deps then its fine.
Error is:
ERROR in ./node_modules/formik/dist/formik.esm.js
Module not found: Error: Can't resolve 'create-react-context' in 'repo/node_modules/formik/dist'
ï½¢wdmï½£: Failed to compile.
Is there some reason this issue is closed? Seems like people are still running into the problem.
@gunn4r This fixed it for me as well. I'm baffled as to why.
EDIT:
node 8.9.4
typescript 3.3.1
react 16.2.0
formik 1.1.1
I haven't looked to verify but I would assume that the plan is to remove the need for this dep since reacts release version of the context api has been out for awhile now. Is that correct @jaredpalmer?
Got this one time to time when app run
/home/....../node_modules/formik/dist/connect.d.ts
(3,66): Cannot find module 'create-react-context'.
Formik 1.5.1, Typescript: 3.3.4000, React 16.8.5, Create React App on Ubuntu 18.04.2
@mSpolsky you saved my day. I'm trying to build without create-react-app and your comment solved the problem.
Thanks.
Still having a problem, not using typescript, see: https://github.com/jaredpalmer/formik/issues/1337#issuecomment-486864870
Most helpful comment
Also getting this issue currently.
Node 10.1.0
React 16.7.0
Typescript 3.2.2
Formik 1.4.2
If I add
create-react-contextto my deps then its fine.Error is:
Is there some reason this issue is closed? Seems like people are still running into the problem.