New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetch is not being called for components added on the client side #9016
Comments
@woutervdm For this use case, I'd recommend using a custom |
Thank you @danielroe, I have tried using fetchKey: 'hello-world', Even using a function that makes sure server and client are using different keys: fetchKey: getKey => `hello-world-${process.server ? 'server' : 'client'}-${getKey()}`, But it seems that |
@woutervdm Thanks for this! If you are expecting dynamic data on a fully static site then you probably want to use |
Thanks. Would be nice if a refetch is performed once the data is not in the payload. I am reusing the same component for parts of the page that are statically generated and for dynamic components. |
NICE,When I refresh the page again, I find that the issue has been closed. |
When adding components on the client side
fetch
is not being called or is linked to the wrong payload data. For instance when showing a dialog that fetches CMS content.Versions
Reproduction
https://github.com/woutervdm/nuxt-fetch-test-case
Using the HelloWorld component:
Steps to reproduce
Run
yarn generate
andyarn start
and click on the "add component" button multiple times.What is Expected?
fetch
should be called for each new component and each added component should contain the text "Hello world!".What is actually happening?
fetch
is not being called and only the firstly added component contains the text. Probably because it is using the same fetch key as the staticly generated component (which also seems incorrect behavior).The text was updated successfully, but these errors were encountered: