-
Notifications
You must be signed in to change notification settings - Fork 6
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
focusAtom type error #6
Comments
Localized the issue to Here is a type of minimal reproducible example. It doesn't show the same verbose error message as in my post above, but it does show that the type does not get inferred correctly. |
Works fine here: https://tsplay.dev/WJ7L6w So, it's a bundler/bundling issue?? |
It loks like that site doesn’t allow to change the tsconfig. I wouldn’t say it’s a bundler issue but rather an issue that occurs under certain typescript settings. |
so, how can we fix it on the library end? |
I haven't looked too deeply into this, but could the root cause be When module resolution is set to When module resolution is set to |
Just had this error after updating Jotai to v2. I was on TS 4.7.4. Updated to 5.0.4. and everything is ok. |
I was facing the same issue with "exports": {
".": {
"types": "./index.d.ts",
"import": "./dist/mjs/index.js",
"require": "./dist/cjs/index.js"
}, but than I saw This issue is fixed by patching the Will try to submit PR to respective repos. |
@cristatus did you submit a PR for it? focusAtom is basically killing my vscode editor because of this 😂 |
Just created here #10 and akheron/optics-ts#318 |
@Aleksion - Would you like to test it on your end with the canary version? Here are the instructions to install @cristatus's solution |
I did - and it solved it. (I forked and tried it manually but didn't get to push it). So all good from here 🎉 |
I just checked that this PR (from @cristatus) on optics-ts repo is merged. I think we should wait for it to be released and see if that fixes the issue 🤔 |
Are we good to close this issue? Did akheron/optics-ts#318 fix it? |
The fix is released in v0.3.1 🚀 |
The example code from the docs
gives this typescript error:
Getting a similar error message also after disabling
exactOptionalPropertyTypes
as the error message suggests:Screenshot for reference:

Using these versions
The text was updated successfully, but these errors were encountered: