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

[CLIENT_FETCH_ERROR] with next-auth and v12.2.5-canary.4 #39495

Closed
1 task done
awareness481 opened this issue Aug 11, 2022 · 3 comments · Fixed by #39504
Closed
1 task done

[CLIENT_FETCH_ERROR] with next-auth and v12.2.5-canary.4 #39495

awareness481 opened this issue Aug 11, 2022 · 3 comments · Fixed by #39504
Labels
bug Issue was opened via the bug report template.

Comments

@awareness481
Copy link
Contributor

awareness481 commented Aug 11, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:42 PST 2022; root:xnu-7195.141.26~1/RELEASE_ARM64_T8101
Binaries:
  Node: 16.15.1
  npm: 8.11.0
  Yarn: N/A
  pnpm: 7.6.0
Relevant packages:
  next: 12.2.5-canary.4
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When trying to login, an error appears. Not happening in earlier canary versions. (can only repro in v12.2.5-canary.4)

{
    "error": {
        "message": "Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON",
        "stack": "SyntaxError: Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON",
        "name": "SyntaxError"
    },
    "url": "/api/auth/session",
    "message": "Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON",
    "client": true
}

ref: nextauthjs/next-auth#5008 (comment)

Expected Behavior

To be able to login

Link to reproduction

https://github.com/awareness481/next-auth-v12.2.5-canary.4

To Reproduce

  1. Clone https://github.com/awareness481/next-auth-v12.2.5-canary.4 (next-auth example with canary version)
  2. Install deps
  3. Try to login
  4. Observe error

(Edit: If you dont have at least one provider setup, you ll get a different error message but it is irrelevant)

@awareness481 awareness481 added the bug Issue was opened via the bug report template. label Aug 11, 2022
@awareness481
Copy link
Contributor Author

Update

I can confirm that this is the PR that is causing the issues #38483 (although weirdly enough, it seems to work for most envs)

To confirm this I:

  1. Setup a local next.js, with the latest version (v12.2.5-canary.4)
  2. Run git revert -m 1 4e6d05575ee6c0c4f78130519f1d3f198bc05084 (reverts above PR)
  3. Setup my repro repo to work with the local next.js
  4. Setup google envs and provider & was able to log in

@kodiakhq kodiakhq bot closed this as completed in #39504 Aug 11, 2022
kodiakhq bot pushed a commit that referenced this issue Aug 11, 2022
This fixes the case where we were incorrectly ignoring the next-auth API endpoint since it matched the `.next` watch ignore and also adds a test case to ensure we match this route correctly. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: #39495
@ijjk
Copy link
Member

ijjk commented Aug 11, 2022

Hi, thanks for the detailed info, this should be fixed in v12.2.5-canary.5, please update and give it a try!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants