When using auth api handlers (such as login) fails due to server modules not being auto-imported. Reproduction repo.
[nuxt] [request error] [unhandled] [500] useEdgeDbPKCE is not defined
at <anonymous> (./node_modules/nuxt-edgedb-module/dist/runtime/api/auth/login.mjs:3:16)
at Object.handler (./node_modules/h3/dist/index.mjs:1851:28)
at Object.handler (./node_modules/h3/dist/index.mjs:1675:31)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1885:7)
|
|
|
export default defineEventHandler(async (req) => { |
|
const pkce = useEdgeDbPKCE(); |
|
const { authBaseUrl } = useEdgeDbEnv(); |
|
|
The modules in src/runtime/server should be auto-imported since the module adds them to Nitro's import paths, but apparently something goes wrong. I'd love to investigate further but I'm not too familiar with Nuxt 3 modules yet. I suspect it's to do with the import folder containing .mjs files instead of .ts.
When using auth api handlers (such as login) fails due to server modules not being auto-imported. Reproduction repo.
nuxt-edgedb/src/runtime/api/auth/login.ts
Lines 2 to 6 in b8338ed
The modules in
src/runtime/servershould be auto-imported since the module adds them to Nitro's import paths, but apparently something goes wrong. I'd love to investigate further but I'm not too familiar with Nuxt 3 modules yet. I suspect it's to do with the import folder containing.mjsfiles instead of.ts.