storyblok / storyblok-astro

Astro SDK for Storyblok CMS
MIT License
164 stars 29 forks source link

storyblokApiInstance has not been initialized correctly #616

Closed MKlblangenois closed 8 months ago

MKlblangenois commented 11 months ago

Describe the issue you're facing

I'm getting the error "storyblokApiInstance has not been initialized correctly" in console.log on each page of the site image

Reproduction

https://astro-espacedupossible-git-feature-canary-110-mediakod.vercel.app/

Steps to reproduce

  1. Install @storyblok/astro
  2. Create a client for Storyblok
    
    import { StoryblokClient, useStoryblokApi } from "@storyblok/astro";

/**

# pages/[folder]/[...page].astro

---
import { createPagination, getStories, getStory } from "../../lib/storyblok";

export const getStaticPaths = async () => {
    const stories = await getStories();

    if (!stories) {
        return {
            notFound: true,
        };
    }

      ...

Here's my astro.config.mjs:

storyblok({
    accessToken: import.meta.env.PUBLIC_STORYBLOK_TOKEN ?? process.env.PUBLIC_STORYBLOK_TOKEN,
    components,
    apiOptions: {
        region: "eu",
        version: "draft",
        cache: {
            clear: "auto",
            type: "memory",
        },
        resolve_relations: ["post.categories"],
    },
    customFallbackComponent: "components/sections/sectionEmpty/index",
    enableFallbackComponent: true,
    bridge: true,
}),

System Info

System:
    OS: macOS 14.0
    CPU: (12) arm64 Apple M2 Pro
    Memory: 683.45 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
  Browsers:
    Brave Browser: 120.1.61.109
    Safari: 17.0

Used Package Manager

npm

Error logs (Optional)

storyblokApiInstance has not been initialized correctly

Validations

samducker commented 10 months ago

Hi is there any update on this issue, I am facing the same. How can we disable this log. My storyblok integration is working fine I just don't want this log. Also getting from react sdk.

dipankarmaikap commented 9 months ago

Hi @samducker I'm unable to reproduce the error on my end. Could you please provide a code repository or steps to help me better understand and investigate the issue?

schabibi1 commented 8 months ago

Hi @MKlblangenois @samducker I'll close this issue as I see this issue thread doesn't look active. Please feel free to re-open when you still face the same issue with additional reproduction sources as my colleague asked above.