storyblok / storyblok-astro

Astro SDK for Storyblok CMS
MIT License
163 stars 28 forks source link

package crashed my server since a few hrs ago #862

Closed Britnell closed 3 months ago

Britnell commented 3 months ago

storyblok.com

hope this is specific enough, but only happened on server. saw an error during pipeline , and server was throwing completely, err 500

must have been most recent changes, was workign yesterday, and broke after my commit 2 hrs ago

Expected Behavior

shouldnt crash and throw errors, useStoryblokApi() should return api object, not undefined

Current Behavior

pipeline showed error storyblokApiInstance has not been initialized correctly , but i couldnt find anything about this

server was throwing 500

12:40:03 [ERROR] TypeError: Cannot read properties of undefined (reading 'get')...

in code :

import { useStoryblokApi } from "@storyblok/astro";
const api = useStoryblokApi();
api.get("cdn/stories", { version })    // error thrown here

i couldnt check the package either, is hasn't worked for a while due to ts error Cannot find module '@storyblok/astro' or its corresponding type declarations.ts(2307) but it worked locally, so i assumed it was only missing types. but i tried replaceing the package with storyblok-js-client , and that fixed it

import StoryblokClient from "storyblok-js-client";
const api = new StoryblokClient({
  accessToken:  '...',
});
api.get(...)

Steps to Reproduce

1. 2. 3.

dipankarmaikap commented 3 months ago

@Britnell Could you please provide the steps to reproduce the error? The "Steps to Reproduce" section is currently empty, and without that information, we cannot identify the cause or assist you with the error.

Thank you!

Britnell commented 3 months ago

hey, yeah will do asap but on the road atm.

what can you say about the error log during build? i couldnt find where that comes from to debug

dipankarmaikap commented 3 months ago

Hi @Britnell ,

Since we haven't received a response with the reproduction steps, we're unable to investigate further.

We'll close this issue for now. If you have new information or can provide the reproduction steps later, feel free to reopen it or create a new issue.

Thanks!