DataProvider not providing data in codegen example.

I have a case where the DataProvider in my code component works in the Plasmic UI, with import from loader-nextjs, but do not providers data in the codegen example, only works when importing from /host, but then it does not provides data in the UI. When the error occurs I have the following error in the console.
I get the following: app-index.js:31 Warning: Cannot update a component (PlasmicProductDetail) while rendering a different component (DataCtxReader). To locate the bad setState() call inside DataCtxReader, follow the stack trace as described}

Thanks for the help

Hi, if you are using codegen, then be sure to not mix both loader and codegen together. You should make sure that your plasmic canvas host is the one from codegen and not from loader. One way to be sure of this is by removing the loader package. Let me know if that helps.

Thanks for the quick response, will try that :slightly_smiling_face: Seems the right cause of the problem

Question I am using import { usePlasmicQueryData } from “@plasmicapp/loader-nextjs”;
Is there an alternative for retrieving data via async fetch call?

Hi, that should exactly allow you to retrieve data via async fetch calls! Just pass it and async method that makes a fetch call. The hook accepts any async method, so you can make fetch calls within it. Let me know if that makes sense, here also is the documentation with an example of that: