framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
23.87k stars 809 forks source link

[BUG]Server Error Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function #2388

Closed AjitSingh-Brar closed 10 months ago

AjitSingh-Brar commented 1 year ago

Hi there,

After installing the framer-motion version 7.0. It gives an error when I am trying to apply on the NEXT Js application of version 14.0.1 and react version 18..2.0. Please let me know how can I resolve the issue

img12

remrcll commented 1 year ago

Same error for me with: "next": "^13.5.6", "react": "18.2.0", "react-dom": "18.2.0", "framer-motion": "^10.16.4",

remrcll commented 1 year ago

I fixed the issue by adding 'use client' on my component. [How does the "use client" directive work in Next.js 13 - stackoverflow]

ehtisham-afzal commented 10 months ago

I fixed the issue by adding 'use client' on my component. [How does the "use client" directive work in Next.js 13 - stackoverflow]

yes mine too It worked by adding 'use client'

codingwithsaleem commented 10 months ago

yes add use client it will work on your component

melvinJD commented 9 months ago

I now have this issue, however I am already using 'use client' ; any help would be greatly appreciated...

madwhopaka commented 9 months ago

When I am using "use client", I am getting another error :

image

codingwithsaleem commented 9 months ago

When I am using "use client", I am getting another error :

image

this error occurred because you did not import the useState hook as react. check on your file where you used this hook and do the correct import. like: import React, { useState } from "react";

madwhopaka commented 9 months ago

Actually I have not used useState anywhere until now. It says the the error is in the framer motion files.

codingwithsaleem commented 9 months ago

Please share project terminal output also your browser console output so maybe I will helpful to fix your issue

Saleem raza

On Fri, 26 Jan 2024 at 1:37 PM, Madhukumar Paka @.***> wrote:

Actually I have not used useState anywhere until now. It says the the error is in the framer motion files.

— Reply to this email directly, view it on GitHub https://github.com/framer/motion/issues/2388#issuecomment-1911672428, or unsubscribe https://github.com/notifications/unsubscribe-auth/A24KLM2MVHUTD62S3HHT3OTYQNTODAVCNFSM6AAAAAA6YYHCACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGY3TENBSHA . You are receiving this because you commented.Message ID: @.***>

FarhanWijonarko commented 6 months ago

Saya memperbaiki masalah ini dengan menambahkan 'gunakan klien' pada komponen saya. [ Bagaimana cara kerja arahan "gunakan klien" di Next.js 13 - stackoverflow ]

thanks bro

moewbasit commented 4 months ago

Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function

i have used 'use client' but still got this error

moewbasit commented 4 months ago

guys im facing this error from past two days but cant find any way to debug it Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function

after deep research, i can say that it MAYBE due to some dependency issues. This is my package.json

"dependencies": { "@toruslabs/eccrypto": "^5.0.1", "@walletconnect/ethereum-provider": "2.13.3", "@web3auth/web3auth": "2.1.3", "bn.js": "^5.2.1", "ethers": "5.7.0", "magic-sdk": "^28.0.7", "moralis": "^2.26.7", "moralis-v1": "^1.13.0", "next": "14.2.4", "pino-pretty": "^11.2.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-moralis": "^1.4.2" }, "devDependencies": { "postcss": "^8", "tailwindcss": "^3.4.1", "yarn-deduplicate": "^6.0.2" } and error remains even after using 'use client' please help me

ZendeAditya commented 4 months ago

ad₫ "use client" to solve this issue

MinhMeoNguyen0 commented 3 months ago

Is there another way not using "use client"?

vishal590 commented 2 months ago

I now have this issue, however I am already using 'use client' ; any help would be greatly appreciated...

I also use "use client" already and yet showing that error