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

Not working in hybrid output #83

Open
aripalo opened this issue Aug 31, 2024 · 4 comments
Open

Not working in hybrid output #83

aripalo opened this issue Aug 31, 2024 · 4 comments

Comments

@aripalo
Copy link

aripalo commented Aug 31, 2024

Even with the addition of prerender = false (see #69), auth-astro does not work with output: "hybrid":

Screenshot 2024-08-31 at 23 18 17

If I modify the output type to server, then it starts working.

@PRODUKT-OS
Copy link

Same issue here

@lokimckay
Copy link

+1

Versions:

"@auth/core": "^0.32.0",
"astro": "^4.15.6",
"auth-astro": "^4.1.2",
npx envinfo
 System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 5.97 GB / 15.93 GB
  Binaries:
    Node: 20.14.0 - C:\dev\apps\nodejs\node.EXE
    npm: 10.8.2 - C:\dev\apps\nodejs\npm.CMD

@Nicolab
Copy link

Nicolab commented Sep 20, 2024

Same here

@CassWindred
Copy link

CassWindred commented Oct 25, 2024

For now, this error does not occur if you follow the workaround in the original issue and just define the [...auth].js file yourself.

I've spent some time deep in the call stack trying to debug what's happening here, but it seems there is a slightly different codepath for endpoints injected by integrations as opposed to those defined by your own files, and at some point in the process, prerender gets set to true and everything else just gets confused from there.

Perhaps export const prerender = false; just doesn't work for injected files, idk more testing needed perhaps.

I haven't gone much further with this right now so there may be more issues with hybrid mode, but defining the file yourself does at least correctly get the file recognised as server-rendered and the endpoint is getting called succesfully at runtime.

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

5 participants