Skip to content
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

TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.createContext) is not a function with Next.js and React 18 #3369

Open
RobinaShaheen opened this issue Aug 6, 2024 · 2 comments

Comments

@RobinaShaheen
Copy link

Issue template

You can donate or became a sponsor https://opencollective.com/react-google-maps-api#category-CONTRIBUTE

If you want to ask question, please ask it in Github Discussions, Spectrum.chat or Slack channel

I am experiencing a TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.createContext) is not a function when using @react-google-maps/api with a Next.js project and React 18.

Please do not post unformatted code into issues, and please do not ask questions. Only real issues, PR's or feature requests are allowed. Minimal reproduction in codesandbox.io is required.

Help wanted

As mentioned in this issue,
the author of this project will only accept issues with codesandbox reproduction and PR with solution going forward.

Please provide an explanation of the issue

Your Environment

os: mac/linux/windows/android/ios

node --version

react version

webpack version

@babel version

@react-google-maps/api version

How does it behave?

How should it behave correctly?

Basic implementation of incorrect behavior in codesandbox.com

@RobinaShaheen
Copy link
Author

anyone idea to solve this issue

@sdkayy
Copy link

sdkayy commented Aug 7, 2024

Seems this is actually a next issue, and the map being inside of a server component using the Context API, try marking your map component a client component with "use client", just ran into this and found this discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants