Closed oldskool73 closed 1 year ago
I can confirm that the same is happening for me in 5.0.1.
I have a feeling that it is because of the defaults in the module: https://github.com/storyblok/storyblok-nuxt/blob/main/lib/src/module.js#L15-L17
Might be time to make a "proper" ts conversion of the module.
Thanks for the confirm @SebbeJohansson , agree it's probably down to the defaults (and not providing a proper/full definition of the ModuleOptions interface)
Also agree on the 'proper ts conversion' comment. The currently included module.d.ts
installed with this module doesn't look correct at all ... ie it doesn't look like a normal d.ts
file, it's just the module.mjs
file with a different extension, and shows multiple of it's own TS errors when I open it...
Any update/movement on this?
@stevengrimaldo i took another look at this, and it looks like the module would need to be properly switched to ts so that defineNuxtModule<ModuleOptions>
works. I tried to do it, but I cant get it to run. Might be above my abilities 😅
Ive only just gone and done it. Only took like 3 hours too!
Closed #296
When using version 5.0.0 in a TS based project using
nuxt.config.ts
, and using the 'block' type of configuration entry (i.e a separatestoryblok: {...}
config entry, instead of inline config under themodules
), typescript shows type errors.If using 'strict' TS checking, this will also throw errors and prevent a dev/build.
Workaround: configure via inline
modules
config instead.Expected Behavior
Can configure via the
storyblok
configuration as normalCurrent Behavior
Can not configure via the
storyblok
configuration as normal, throws TS errors.Steps to Reproduce
storyblok-nuxt
storyblok: {...}
configuration block tonuxt.config.ts
, observer type errors on dev/generate/typecheck