-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
[BUG] Types not found with TypeScript 4.7 in ESM mode #1543
Comments
This still happens for me with typescript 4.7.4 and framer-motion 6.3.16 Repro: https://stackblitz.com/edit/vitejs-vite-caff2t?file=package.json |
I am still encountering issues due to framer-motion pulling in popmotion (and some of its sister packages) which have basically the same problem. I have opened a PR on that package to address this. |
After some experimenting, I think the remaining issue is that the existence of the |
popmotion is not a direct dependency, so remove it from package.json's dependencies. But instead force the version to 11.0.5 via overrides due to motiondivision/motion#1543. Change-Id: I515d532fd6f9ff64e83b0c3dcf96c5d24454dc4b
1. Read the FAQs 👇
2. Describe the bug
The next version of TypeScript, 4.7, introduces proper support for ESM. It now also supports the package.json
exports
map. A consequence of this appears to be that theexports
map already specified inframer-motion
effectively hides thetypes
field and so TypeScript cannot find the types any more.In the case of the repro below, you will see the following error:
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
A CodeSandbox minimal reproduction will allow us to quickly follow the reproduction steps. Without one, this bug report won't be accepted.
https://stackblitz.com/edit/vitejs-vite-pj1qjj?file=main.ts
4. Steps to reproduce
Steps to reproduce the behavior:
npm run build
5. Expected behavior
The build should succeed (code itself is trivial/doesn't do anything).
6. Video or screenshots
N/A
7. Environment details
TypeScript 4.7.1-rc
Further details: microsoft/TypeScript#46334
The text was updated successfully, but these errors were encountered: