aahhuhuhu
aahhuhuhu

Reputation: 493

Error occurs when importing framer-motion

Install framer-motion and import { Frame, useMotionValue, useTransform } from 'framer';. However, I get the following error.

Cannot find module 'framer' or its corresponding type declarations.ts(2307)

Upvotes: 2

Views: 17870

Answers (3)

Stephen Gbolagade
Stephen Gbolagade

Reputation: 21

I got this same error, although framer-motion had been working perfectly fine before then.

## How I solved it

I deleted the node_modules folder and then ran yarn add framer-motion again.

And the error is gone.

Upvotes: 0

ChilTest
ChilTest

Reputation: 511

npm i framer-motion

after:

import { useMotionValue, useTransform } from "framer-motion"
import { Frame } from "framer"

You misunderstood "framer-motion" and "framer"

Upvotes: 2

Gayatri Dipali
Gayatri Dipali

Reputation: 1283

You installed framer-motion right? Then you will have to import from that lib itself!

You do like this :

import { Frame, useMotionValue, useTransform } from "framer-motion"

Upvotes: 0

Related Questions