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

Issue with module augmentation seems to be happening again #807

Open
trc-mathieu opened this issue Jul 16, 2024 · 4 comments
Open

Issue with module augmentation seems to be happening again #807

trc-mathieu opened this issue Jul 16, 2024 · 4 comments
Labels
bug A bug that needs to be resolved p4 Important Issue

Comments

@trc-mathieu
Copy link

Environment


  • Operating System: Linux
  • Node Version: v20.13.1
  • Nuxt Version: 3.12.2
  • CLI Version: 3.12.0
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

You can simply clone this repository, open in VS code and navigate to playground-authjs/pages/index.vue and mouse over on auth key. The type is not correctly augmented.

Describe the bug

The MiddlewareMeta is not recognized by definePageMeta macro. This issue happened in the past and it is happening to me now.
The modification that was made here does fix the issue: #397 but it was rolled back by @danielroe here #582

I have this issue on other modules as well and augmenting from #app/../pages/runtime/composables does work.

@danielroe, do you mind trying again the latest version of this repo?

using #app
Screenshot 2024-07-16 at 9 58 55 AM
Screenshot 2024-07-16 at 9 59 05 AM

using #app/../pages/runtime/composables

Screenshot 2024-07-16 at 9 59 29 AM
Screenshot 2024-07-16 at 9 59 47 AM

Additional context

No response

Logs

No response

@trc-mathieu trc-mathieu added bug A bug that needs to be resolved pending An issue waiting for triage labels Jul 16, 2024
@danielroe
Copy link
Contributor

It would be a good idea to add a type test to this repo if this is occurring, to ensure it doesn't happen in future.

I suspect the issue is that rightly or wrongly we are augmenting it in Nuxt like this:

https://github.com/nuxt/framework/pull/2858/files#diff-df395205486536ffc90235a4d30334e7d53ea5519d778996ac209cdc5e26a53dR106

I can investigate whether we can update this in Nuxt to augment PageMeta from #app instead. Would you provide a minimal reproduction outside of this repo (without using sidebase auth), and raise it in https://github.com/nuxt/nuxt directly? 🙏

@zoey-kaiser zoey-kaiser added p4 Important Issue and removed pending An issue waiting for triage labels Jul 16, 2024
@trc-mathieu
Copy link
Author

@danielroe I will open a repro, thank you.

@zoey-kaiser
Copy link
Member

zoey-kaiser commented Jul 16, 2024

Hi @trc-mathieu

Thanks for (re) opening an issue for this! I would love to follow along with the issue created in the Nuxt repo and then follow-up and fix the issue in our module based on the outcome.

Otherwise, we can always revert the change to ensure the types work correctly again, but I would propose to wait a bit and see if any news happen 🤗

@phoenix-ru
Copy link
Collaborator

Let's wait for Nuxt 3.12.5 and do a version bump to close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that needs to be resolved p4 Important Issue
Projects
None yet
Development

No branches or pull requests

4 participants