-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
bug: Rollup Error in Nuxt while importing logtoEventHandler from @logto/nuxt #909
Comments
@wangsijie I see that you were assigned to other nuxt related issues. Do you have an idea? |
Will take a look |
I just ran into the same issue. I am not too familiar with nuxt modules however i've looked at some other modules and noticed that they define an alias for the server side imports. For example in the sidebase nuxt-auth module (https://github.com/sidebase/nuxt-auth/blob/956b0fa1b5aed3fb94a47563a9e47dc811940a6a/src/module.ts#L170-L182)
I've created a pnpm patch to try this out and it seems to solve the issue
I just had to change the import in my api route to use the new alias like this I also noticed that typescript cannot find a type definition for "event.context.logtoClient" so it just returns "any". I think this can be solved by adding a type declaration to the module like it is described here: https://nuxt.com/docs/guide/going-further/modules#adding-type-declarations |
Describe the bug
If I create a
server/api/auth/get-access-token.ts
as described in Use in middleware or API routes, the following error occurs.The same error occurs in a server middleware.
Expected behavior
No error must occur.
How to reproduce?
See reproduction example.
The text was updated successfully, but these errors were encountered: