Skip to content

Server modules not getting auto-imported #2

@juni0r

Description

@juni0r

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions