nextacular / nextacular

An open-source starter kit that will help you build full-stack multi-tenant SaaS platforms efficiently and help you focus on developing your core SaaS features. Built on top of popular and modern technologies such as Next JS, Tailwind, Prisma, and Stripe.

Home Page:https://nextacular.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

White page on refresh

WebDev-Akhil opened this issue · comments

Workspace on refreshing the page shows a blank white page even when the user is logged in. (and shows a blank black page when tried in incognito mode)

Expected behaviour: should show the workspace contents upon validating the session. Should return a 404 page if the session is not found (eg: incognito mode or user not logged in).

Replicate the behaviour: goto locahost:3000/account/someworkspace and refresh your page in the browser

This is in relation to: #20

We'll wait for the RFC so that we can improve our layout and app routing. In the meantime, if you have suggestions, we can work it together. Thanks! :D

@madhurjain @arjayosma

I don't think this PR fixed #28.

The workspace dashboard stills returns white page (eg. http://localhost:3000/account/test1)

I think this is because of useWorkspace() not loading when the user reloads the page.

In src/pages/account/[workspaceSlug]/index.js, if you replace the current return with something static (example code below) then it will work but if you want to consume useWorkspace() it doesn't work

the below works on reload (as it is static)

return (
  <AccountLayout>
    <Meta title={`Nextacular - some hardcoded name | Dashboard`} />
    <Content.Title
      title="some hardcoded name"
      subtitle="This is your project's workspace"
    />
    <Content.Divider />
    <Content.Container />
  </AccountLayout>
);

the below doesn't works (as it consumes useWorkspace() and, on page reload it is not being fetched)

return (
    workspace && (
      <AccountLayout>
        <Meta title={`Nextacular - ${workspace.name} | Dashboard`} />
        <Content.Title
          title={workspace.name}
          subtitle="This is your project's workspace"
        />
        <Content.Divider />
        <Content.Container />
      </AccountLayout>
    )
  );

Correct me if I'm wrong