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

fix: public runtimeconfig types #11

Merged
merged 10 commits into from
Jun 29, 2023
Merged

Conversation

Hebilicious
Copy link
Owner

Attempt to fix the type error that happens due to nuxt 3.6

Comment on lines 1 to 7
declare module "nuxt/schema" {
interface PublicRuntimeConfig {
__serverLoaders__: string[]
}
}

export { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't being distributed with your module. You can add it to runtime directory and then add it to the end user's project with prepare:types hook. Or add a type template to do this. You might even be able just to move these lines into module.ts, but I haven't confirmed if that's enough.

Copy link
Owner Author

@Hebilicious Hebilicious Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially had it in module.ts and that didn't work. It's a little annoying that this needs to be manually included as part of the module runtime T_T
Maybe we can have a convention that nuxt module bundler will detect automatically, like nuxt-types.d.ts in src ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, this is only intended within the module code, ie not for end users? You can probably move the types.d.ts out of src then. It shouldn't be in the build in that case

@Hebilicious
Copy link
Owner Author

@danielroe Unfortunately your suggestion doesn't work. It looks like nuxt-build-module requires additional configuration now.

@Hebilicious Hebilicious changed the title Fix-public-runtimeconfig-types fix: public runtimeconfig types Jun 29, 2023
@Hebilicious Hebilicious merged commit 90719d7 into main Jun 29, 2023
@Hebilicious Hebilicious deleted the fix-public-runtimeconfig-types branch June 29, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants