storyblok / storyblok-nuxt

Storyblok Nuxt module
https://www.storyblok.com/tp/nuxt-js-multilanguage-website-tutorial
272 stars 42 forks source link

ERROR Component could not be found for blok "ComponentName"! Is it defined in main.ts as "app.component("ComponentName", ComponentName); #816

Closed ybabenkoJapp closed 5 months ago

ybabenkoJapp commented 5 months ago

Describe the issue you're facing

Hi guys! I've removed a component from Storyblok's blok library Знімок екрана 2024-04-18 о 16 06 13 and from the nuxt project

Знімок екрана 2024-04-18 о 16 27 31

, I cleared all the stories in which the component was used. But I can't manually build the project on SSG mode and deploy it on Netlify, and receive an error instead

Знімок екрана 2024-04-18 о 16 11 53

Please help to solve it.

Reproduction

x

Steps to reproduce

x

System Info

macOS Sonoma 14.4.1

"@storyblok/nuxt": "^6.0.3",
 "nuxt": "^3.7.3",
  nitro 2.8.1     

export default defineNuxtConfig({
 // auto import components
  components: true,
  nitro: {
      prerender: {
        ignore: ['/global', '/dev'],
      },
    },
  modules: [
    [
          '@storyblok/nuxt',
          {
            accessToken: myTokenIsHere,
            // enable bridge and devtools only in devMode
            bridge: isDevEnvironment === 'TRUE',
            devtools: isDevEnvironment === 'TRUE',
            apiOptions: {
              region: 'eu',
            },
          },
        ],
  ]
})

Used Package Manager

yarn

Error logs (Optional)

✓ built in 11.82s 2:55:53 PM ✔ Server built in 11846ms 2:55:53 PM ℹ Initializing prerenderer nitro 2:55:53 PM ℹ Prerendering 60 initial routes with crawler nitro 2:55:57 PM ├─ /404.html (138ms) nitro 2:55:57 PM ├─ /200.html (137ms) nitro 2:55:57 PM ├─ /404 (1385ms) nitro 2:55:58 PM ├─ /404/_payload.json (34ms) nitro 2:55:58 PM ├─ / (1431ms) nitro 2:55:58 PM ├─ /_payload.json (20ms) nitro 2:55:58 PM ├─ /en/404 (1484ms) nitro 2:55:58 PM ├─ /en/404/_payload.json (51ms) nitro 2:55:59 PM [2:55:59 PM] ERROR Component could not be found for blok "download-button"! Is it defined in main.ts as "app.component("download-button", download-button);"? ✔ Generated public dist nitro 2:56:10 PM ✔ You can preview this build using npx serve .output/static nitro 2:56:10 PM ✔ You can now deploy dist to any static hosting! 2:56:10 PM ✨ Done in 44.33s.

Validations

alvarosabu commented 5 months ago

Hi @ybabenkoJapp can you try clearing the .nuxt cache https://nuxt.com/docs/api/commands/cleanup?

ybabenkoJapp commented 5 months ago

@alvarosabu thank you for your response. Tried npx nuxi cleanup - didn't help

alvarosabu commented 5 months ago

Mmm, @ybabenkoJapp could you check the draft json on your visual editor to see if the component is still present there?

Screenshot 2024-04-18 at 15 47 42

ybabenkoJapp commented 5 months ago

@alvarosabu I did an investigation right before and checkout the draft and published versions. But anyway, let's do it one more time

alvarosabu commented 5 months ago

Is just to know if is something in the cache of the product and the cdn that the component still in the response or is a nuxt cache thing

ybabenkoJapp commented 5 months ago

@alvarosabu it will take some time I'll be back once all is set

ybabenkoJapp commented 5 months ago

@alvarosabu thank you for your help. it was a cache issue.

Prepahs, someone finds it useful, please look at cache-invalidation