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

declare module '@nuxt/schema' breaks RuntimeConfig's type determination. #319

Closed
kiki-kanri opened this issue Dec 7, 2023 · 1 comment · Fixed by #320
Closed

declare module '@nuxt/schema' breaks RuntimeConfig's type determination. #319

kiki-kanri opened this issue Dec 7, 2023 · 1 comment · Fixed by #320
Assignees
Labels
bug Something isn't working

Comments

@kiki-kanri
Copy link

kiki-kanri commented Dec 7, 2023

Version

nuxt-security: v1.0.0-rc.5
nuxt: v3.8.2

Reproduction Link

v1.0.0-rc.4 https://stackblitz.com/edit/github-czgrdm-zhuae5

v1.0.0-rc.5 https://stackblitz.com/edit/github-czgrdm-ca4shv

Steps to reproduce

Open the rc.4 and rc.5 repositories and check the runtimeConfig.testServerString type in server/api/index.ts.

What is Expected?

In the rc.5 version of the repository, the type of runtimeConfig.testServerString is string.

What is actually happening?

The type of runtimeConfig.testServerString is either any or unknown.

After testing, I found that changing "declare module '@nuxt/schema'" back to "declare module 'nuxt/schema'" can fix the problem.

It is assumed that the use of @nuxt/schema overwrites the definitions in the .nuxt/types/schema.d.ts file and causes the types in the runtimeConfig object to be missing from the other package settings.

@kiki-kanri kiki-kanri added the bug Something isn't working label Dec 7, 2023
@vejja vejja self-assigned this Dec 7, 2023
@vejja vejja linked a pull request Dec 7, 2023 that will close this issue
6 tasks
@vejja
Copy link
Collaborator

vejja commented Dec 7, 2023

@kiki-kanri
Thanks for not only reporting, but also providing the fix 🚀

PR #320 fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants