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

'loading' is always true in production build #2446

Closed
Gabsys opened this issue Jul 29, 2021 · 2 comments
Closed

'loading' is always true in production build #2446

Gabsys opened this issue Jul 29, 2021 · 2 comments
Labels
bug Something isn't working incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help.

Comments

@Gabsys
Copy link

Gabsys commented Jul 29, 2021

Description 🐜

The loading in const [session, loading] = useSession() is always returning true in production build. Works fine in development mode though.

Is this a bug in your own project?

No

How to reproduce ☕️

import { useSession } from 'next-auth/client'

export default function Page() {
   const [session, loading] = useSession();

   if (loading) return null
   return (
      <p>Session valid</p>
   )
}
  1. npm run build
  2. npm run start

Screenshots / Logs 📽

No response

Environment 🖥

System:
OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (2) x64 Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
Memory: 810.82 MB / 1.94 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 12.22.1 - ~/.nvm/versions/node/v12.22.1/bin/node
npm: 6.14.12 - ~/.nvm/versions/node/v12.22.1/bin/npm
npmPackages:
next: 10.2.3 => 10.2.3
next-auth: ^3.25.0 => 3.25.0
react: 17.0.2 => 17.0.2

Contributing 🙌🏽

No, I am afraid I cannot help regarding this

@Gabsys Gabsys added the bug Something isn't working label Jul 29, 2021
@balazsorban44
Copy link
Member

I cannot reproduce this. You will need to provide a more detailed reproduction or I'm going to move this to discussions. You can use any of our CodeSandbox templates for convenience (it was available in the issue form you filled out.)

@balazsorban44 balazsorban44 added the incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. label Jul 29, 2021
@Gabsys
Copy link
Author

Gabsys commented Jul 29, 2021

Managed to locate the culprit. Not NextAuth's issue but a package's css file that is imported which spoil the app for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help.
Projects
None yet
Development

No branches or pull requests

2 participants