[BUG] TypeScript error when importing framer-motion/three
See original GitHub issue1. Read the FAQs 👇
2. Describe the bug
TypeScript error when importing framer-motion/three
.
Cannot find module ‘framer-motion/three’ or its corresponding type declarations.
Framer motion works as expected with all animations. However, TypeScript is not happy with the import and does not have typechecking or autocomplete.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/s/r3f-framer-motion-xx9kc?file=/src/App.tsx
4. Steps to reproduce
Steps to reproduce the behavior:
- Go to
App.tsx
file in Sandbox - Go to the
framer-motion/three
import - See the import error
5. Expected behavior
There is no error when importing framer-motion/three
in TypeScript and the typechecking/autocomplete works for all framer-motion properties.
6. Video or screenshots
7. Environment details
Version 5.4.5 of framer-motion.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Typescript import error with when importing a composed ...
I'm facing a weird import error when I try to import a redux compose component, I can't tell what's causing it, I've installed...
Read more >Documentation - TypeScript 2.4
Dynamic import expressions are a new feature and part of ECMAScript that allows users to ... This can improve your experience and catch...
Read more >TypeScript errors and how to fix them
This error occurs when you import the same file in two different files using two different casing styles (ex. camelCase and UpperCamelCase):. File...
Read more >Announcing TypeScript 4.8 RC - Microsoft Developer Blogs
This behavior was incorrect, because named imports and exports for values that don't exist will cause a runtime error under ECMAScript modules.
Read more >TypeScript support in Svelte - Learn web development
Early spotted bugs: The compiler checks types at compile time and provides error reporting. Readability: Static typing gives the code more ...
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 FreeTop 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
Top GitHub Comments
FYI next week we’re going to move this to its own framer-Motion-3d package which will fix this
As a temporary workaround I’ve found that declaring “framer-motion/three” like below seems to work: