strapi / strapi-starter-gridsome-portfolio

Build portfolio sites using Strapi and Gridsome
https://strapi-starter-gridsome-portfolio.vercel.app
MIT License
33 stars 9 forks source link

getting error #5

Closed lorvent closed 3 years ago

lorvent commented 3 years ago

Hello, when i try to open gridsome in brower, getting following error

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in getter for watcher "$metaInfo": "TypeError: Cannot read property 'strapi' of null"

found in

---> <Index> at src/pages/Index.vue
       <App> at node_modules/gridsome/app/fallbacks/App.vue
         <Root>

can you tell me what went wrong?

thanks.

wujido commented 3 years ago

Hi, i don't know what exactly went wrong, but i run the same issue today. And I found fix for that. Just run:

yarn strapi install graphql

inside backend folder and restart strapi server.

lorvent commented 3 years ago

Hello, thanks for the fix, it works now. eventhough admin panel shows graphql is installed...i guess there is a glitch.

Also.... this setup always connects to strapi.... it doesn't generate static files but instead always connects to strapi server.... am i correct?

just like any typical DB based (php or wordpress) type of setup right?

thanks.

lorvent commented 3 years ago

may be i missed somewhere but i thought this would export all data to markdown files into gridsome by parsing data using graphql.

lorvent commented 3 years ago

another thing i found is... eventhough it is fetching data dynamically, whenever i add a new portfolio, i need to stop and start gridsome develop each time.

wujido commented 3 years ago

another thing i found is... eventhough it is fetching data dynamically, whenever i add a new portfolio, i need to stop and start gridsome develop each time.

It's the way how gridsome works. It needs to have all data at build time. So it fetch data only once and then when you develop it rebuild only templates.

wujido commented 3 years ago

Also.... this setup always connects to strapi.... it doesn't generate static files but instead always connects to strapi server.... am i correct?

just like any typical DB based (php or wordpress) type of setup right?

Actually you can use it as static site. You just need to rebuild site every time you change data in Strapi. You can use webhook for that if you have CD which support that. For example with netlify build hook.

lorvent commented 3 years ago

thanks, that clarifies.