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

__vite_ssr_import_0__.NextAuthHandler is not a function #4

Open
bbigras opened this issue Jan 20, 2023 · 2 comments
Open

__vite_ssr_import_0__.NextAuthHandler is not a function #4

bbigras opened this issue Jan 20, 2023 · 2 comments

Comments

@bbigras
Copy link

bbigras commented Jan 20, 2023

to reproduce:

  • npm update
  • npm run dev
09 h 43 min 56 s [vite] Internal server error: __vite_ssr_import_0__.NextAuthHandler is not a function
      at getServerSession (/src/server/auth/auth.ts:83:45)
      at eval (/src/server/auth/withSession.ts:7:31)
      at async eval (/src/utils/endpointBuilder.ts:5:42)
      at async next (/home/bbigras/src/qwik-next-auth-example/node_modules/@builder.io/qwik-city/vite/index.cjs:26808:33)
      at async loadUserResponse (/home/bbigras/src/qwik-next-auth-example/node_modules/@builder.io/qwik-city/vite/index.cjs:26821:3)
      at async /home/bbigras/src/qwik-next-auth-example/node_modules/@builder.io/qwik-city/vite/index.cjs:27192:32 (x3)
@wmalarski
Copy link
Owner

Hello. I updated dependencies to the latest here #5. I switched from next-auth to new auth.js. This example should work fine for dev and preview modes. But there are still some issues with running the express adaptor. I don't know what's happening there yet.

@bbigras
Copy link
Author

bbigras commented Feb 8, 2023

there are still some issues with running the express adaptor. I don't know what's happening there yet.

If you mean this error:
TypeError [ERR_INVALID_STATE]: Invalid state: WritableStream is closed

It seems that updating qwik and qwik-city fixes it!

diff --git a/package.json b/package.json
index 578600a..5202e14 100644
--- a/package.json
+++ b/package.json
@@ -23,8 +23,8 @@
     "qwik": "qwik"
   },
   "devDependencies": {
-    "@builder.io/qwik": "0.16.2",
-    "@builder.io/qwik-city": "0.1.0-beta9",
+    "@builder.io/qwik": "0.17.5",
+    "@builder.io/qwik-city": "0.1.0",
     "@types/compression": "^1.7.2",
     "@types/cookie": "^0.5.1",
     "@types/eslint": "8.4.10",

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