8ear
8ear
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter But even if you use useFetch, it doesn't necessarily mean that it will become SSG.😓
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
This issue has been resolved. It was caused by something written in $fetch. The part where the API was retrieved with useFetch was SSG, and it seemed that the part written in $fetch was calling the API even though SSG was set. I hope this can be of some help to anyone who is experiencing the same thing.
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter That's right.😓 Thank you for listening to me so kindly. I would really like to show you everything, but it's a work project so I can't. I'll come back to you and ask for your help when I figure out how to reproduce it. Thank you for your time! I've subscribed to your YouTube channel!
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
The nuxt.config.js of the project where the problem is occurring is as follows.
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter Thank you for your kind reply. I still haven't figured out how to reproduce the problem, but a project created in a similar way (using the same base nuxt.config.js settings and calling the API in the same way) works as expected. By the way, here is the sample I created. But I can't reproduce the problem with this one. https://github.com/P0lar8ear/kuroco-nuxt
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter All pages are being generated. However, the API is being called on the client side and this problem is not being solved, so I suspect there may be a problem with the way the API is being called. When I looked into it, I found literature that said that useFetch doesn't work and that asyncData should be used, so I'm confused. Even when I rewrite the parts that use $fetch to asyncData, the root cause is not solved... (although I feel like the way asyncData is being used is not relevant to this case in the first place) I don't know how to debug because generate completes without any errors.😭
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
<script setup> const { data: response } = await useFetch( apipath, { credentials: "include", } ); </script> <template> {{ data }} </template>
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter That's right. I think it's correct that the data won't be updated and displayed unless you rebuild it. This is how it's written to get the API, but is it wrong?
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter Sorry! I overlooked that command being displayed. But the data was reflected immediately after all...
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
Could you please tell me why you don't use pnpm preview? ? How can I check the generated screen? (I'm sorry if this is already explained in the video)
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
I run pnpm generate and check the screen with pnpm preview at localhost:3000, but it doesn't become SSG and the API is called with the client.😭
35 replies
NNuxt
Created by 8ear on 9/14/2024 in #❓・help
Not SSG
@manniL / TheAlexLichter Thank you for your reply. I immediately deleted target: "static", but the same problem occurs. I watched the video, but it's a bit difficult for me... sorry. Is there anything else I should look at or check?
35 replies