Skip to content
This repository has been archived by the owner on Mar 7, 2022. It is now read-only.

Support for Next.js 12 and NextAuth v4 #14

Closed
ffleandro opened this issue Nov 9, 2021 · 6 comments
Closed

Support for Next.js 12 and NextAuth v4 #14

ffleandro opened this issue Nov 9, 2021 · 6 comments

Comments

@ffleandro
Copy link

I'm currently trying to use this library using the following versions of Nextjs and NextAuth, but having the below error:

dependencies:

next: 12.0.3
next-auth: 4.0.0-beta.6
node: v14.18.1
typescript: 4.4.4

error:

> Build error occurred
Error: Dynamic require of "react" is not supported
    at xe (file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:1:294)
    at file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:1:39268
    at file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:1:373
    at file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:4:497
    at file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:1:373
    at file:///myproject/node_modules/@next-auth/react-query/dist/index.mjs:4:14209
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24) {
  type: 'Error'
}
@micahbule
Copy link

See #7 (comment)

Even the author suggested that it might be better to implement this as a snippet rather than maintaining it as a module given how small the module is and pretty much straightforward.

@balazsorban44
Copy link
Member

Yes. Unfortunately, I had to move away from this implementation and thus don't have the time to properly maintain it, but if anyone wants to pick it up, just tell me!

@joshmedeski
Copy link

@balazsorban44 what do you recommend using now? For those of us that use React Query and Next Auth together.

@micahbule
Copy link

@balazsorban44 what do you recommend using now? For those of us that use React Query and Next Auth together.

You can check #7

@JensMou
Copy link

JensMou commented Mar 3, 2022

Yes. Unfortunately, I had to move away from this implementation and thus don't have the time to properly maintain it, but if anyone wants to pick it up, just tell me!

How does it look now? Or do you have any other suggestions for those using react-query, next-auth@4 and next@12?

@micahbule
Copy link

Hi @JensMou, as the author suggests in #7, you can just implement this is a snippet instead of maintaining a module for it. Less dependencies means better maintenance. You can literally open this file https://github.com/nextauthjs/react-query/blob/main/index.js, copy the content, and save it as a custom hook in your code base.

I do like to suggest to the author marking this module outdated/deprecated if no one is taking up the offer to take over.

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

No branches or pull requests

5 participants