@chungwu I hate to keep bugging you about this but I’ve burned the better part of 2 work days trying to switch plasmic over from headless to codegen mode. Are you able to set up a zoom call where we can work through these issues live? I really want to keep using Plasmic but if I can’t make codegen work I am probably at the end of the road here
I am free anytime between 11:30am–6:30pm Pacific tomorrow
Sure! Happy to. But for srcDir, can you try changing it to ./components
? It should be relative to the location of the plasmic.json file. If it doesn’t start with .
or ..
, it treats the srcDir as an absolute URL instead.
Away from desk now, will try in a few hours
I think I already tried ./components for my srcDir (see above) but have not tried ./src/components yet
Will try that. But tbh the plasmic cms stuff seems to be the biggest blocker right now, the rest is just annoying quirks w plasmic sync that I can probably work around
So lmk if you have thoughts on how to debug plasmic cms specifically
It worked fine when I render it via loader, but not via codegen
hmm do you have <GlobalContextsProvider />
somewhere? It’s also a generated file that should hold and provide things like CMS credentials to the CMS provider
I did not have <GlobalContextsProvider />
anywhere. Just added it, now I have something like this in my _app.tsx
file:
return (
<PlasmicRootProvider>
<PlasmicGlobalContextsProvider>
<ChakraProvider theme={theme}>
<QueryClientProvider client={queryClient}>
<Component {...pageProps} />
</QueryClientProvider>
<GoogleAnalytics trackPageViews />
</ChakraProvider>
</PlasmicGlobalContextsProvider>
</PlasmicRootProvider>
);
Not sure if this is related but there seem to be two PlasmicGlobalContextsProvider
files in my project:
plasmic/osito/PlasmicGlobalContextsProvider.tsx
plasmic/plasmic_cms/PlasmicGlobalContextsProvider.tsx
And when I attempt to clean all the plasmic build files and rebuild, I sometimes get this
Detected file moved from plasmic/osito/PlasmicGlobalContextsProvider.tsx to plasmic/plasmic_cms/PlasmicGlobalContextsProvider.tsx.
Gonna call it a night. Still no luck getting codegen to work fully
@chungwu I’m available to zoom anytime starting 11:30am Pacific tmrw. Let me know when works for you
ok! actually could you share the repo with me? may be easier to poke around there
Sure, it’s already shared w plasmic ops
https://github.com/ositoai/osito
lmk your github username if you want me to share with you personally also
my latest attempt is on branch plasmic-codegen-3
current status is that the imports are working but CMS is not working and when i try to load the project in plasmic studio with localhost:3000/plasmic-host all my components render as blank
that last problem is a new one - it’s like a game of whack a mole