-
Notifications
You must be signed in to change notification settings - Fork 31
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
missing StoryblokComponent.astro type declarations #352
Comments
Hey @doovis, thanks for reporting this bug. However, I cannot reproduce this behavior, neither in your example nor any other project. Are you still facing this issue? |
Hello @manuelschroederdev , I am able to reproduce a similar issue with @storyblok/astro package .Screenshot below |
I have the same issue as well. It's this virtual module. Also get another type error on blok.component StoryblokComponent.astro
Argument of type 'string | undefined' is not assignable to parameter of type 'string | readonly string[]'.
Type 'undefined' is not assignable to type 'string | readonly string[]'.ts(2345) |
I made a PR for the latter: |
Hey, second this, have the exact same error i am following the astro guide
|
I am getting the exact same error like @Britnell with the exact same dependencies. |
🎉 This issue has been resolved in version 3.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hey @shixish, thanks for sharing. That's weird and I cannot reproduce it. Could you please share a minimal reproducible example? |
@manuelschroederdev I put together a minimal setup here: The issue can be seen in both of these files:
I tried out this new repo with my Storyblok preview token and this repo appears to work. 👍 |
🎉 This issue has been resolved in version 3.1.0-next.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I'm currently having an error similar like above where camelcase is giving a type error: I'm on node 21.3.0 using pnpm and tried out every version of the storyblok-astro package but having this issue on every version. |
I see the same error shared by @shixish and @Britnell on version ^4.0.0. I'm following the example from Storyblok & Astro integration docs |
I stumbled upon this issue too with As per https://stackoverflow.com/a/74976845,
it seems the client need to set the moduleResolution in the tsconfig compilerOptions: tsconfig.json ...
"compilerOptions": {
"moduleResolution": "nodenext", // also node16 or bundler
...
}
... It seems I see that the DEMO https://stackblitz.com/edit/astro-sdk-demo?file=tsconfig.json extends from astro/tsconfigs/base which has the: |
Thanks everyone for reporting.
Feel free to re-open this issue if you face a similar case. |
@ybabenkoJapp probably related to #1033 - or better said that's the new issue for it |
Describe the issue you're facing
When building a page with Astro importing StoryblokComponent.astro component into .astro file gives back a type declaration error. However, other SDK's functions like "useStoryblokApi" are not giving any errors.
The Astro app is running even with an error and the StoryblokComponent is working. But ideally the error should not be there. I could not find any @types/ packages for the @storyblok/astro SDK. But if I go to /src/env.d.ts and provide this line of code: "declare module '@storyblok/astro/StoryblokComponent.astro';" the type error goes away.
Reproduction
https://github.com/doovis/storyblok-bug/blob/master/src/pages/index.astro
Steps to reproduce
Just opening up /src/pages/index.astro should show the error on the "StoryblokComponent" import line.
System Info
Used Package Manager
yarn
Error logs (Optional)
No response
Validations
The text was updated successfully, but these errors were encountered: