There’s no “loading” pop up as I see on the dev server. On Vercel, what actually happens is there’s a several second wait before anything happens. Then it loads into a fully loaded page with no loading popup.
I’m happy to do whatever as long as its best practice - what should I be doing for instant page loads? I tried the following to test out staticpaths on two of my pages, but I’m a bit clueless here:
What ALSO seems weird is on the dynamic pages, clicking off the page (like clicking the logo to return to the homepage which is static) takes a few seconds too.
Hi @tom_prest-drawbridge , the issue is that the data is not being fetched and pre-rendered on the server. You can verify by disabling JS and seeing nothing ever loads. It’s being requested on the browser which kills perf.
If you use the quickstart code here, it should be doing proper pre-loading of the data - are you already using this code?
One thing to note is that my CMS integration may not be perfect right now but that’s not even the cause of the prolem as moving between static pages also has this loading time issue.
EDIT: Double checked that preview was set to false on build and that’s correct, so that’s one potential cause ruled out.
const isDevelopment = process.env.NODE_ENV === 'development';
console.log("Plasmic preview mode:", isDevelopment);
export const PLASMIC = initPlasmicLoader({
projects: [
{
id: process.env.NEXT_PUBLIC_PLASMIC_ID!,
token: process.env.NEXT_PUBLIC_PLASMIC_TOKEN!,
},
],
// By default Plasmic will use the last published version of your project.
// For development, you can set preview to true, which will use the unpublished
// project, allowing you to see your designs without publishing. Please
// only use this for development, as this is significantly slower.
preview: isDevelopment,
});
Also disabled the above and just put “false” for testing purposes and still have the same issue:
@yang is it best/appropriate for me to render these pages statically on build like so? The data may change from time to time but will be mostly static.
Apologies for the delayed response. The issue should already be fixed. If you update your plasmic npm libraries to the latest versions, then the loading should work out of the box again. Can you confirm this with your repo?
I didn’t get round to replying to this sooner. Ignore the section on the homepage - go to any of the services pages and you’ll see there’s often a several second delay before anything happens.
Please let me know if this helps, I am able to get it pre-rendering fine on a brand new nextjs app, so I think it may be due to the quickstart catch-all used for these pages…
Unfortunately I’ve cloned the project, hosted on Plasmic hosting and same issue. You’ve mentioned pre-rendering is working fine on your version, but as far as I can tell there was still the same problem of a massive delay in waiting for the page to load.
I’ve just tested this on a fresh clone on plasmic hosting and there’s 3-5 seconds of waiting for response before the page does anything. This is obviously really, really bad UX I’m just trying to identify what the source of this delay is?
Even with static pages, I was facing a long server response and couldn’t work it out.
Turns out my static pages were fine, it was the method I was navigating to them with. I was using onClick, which naturally had to retrieve the slug from the APIs before navigating.
Since converting all my buttons to components, all is well.