Skip to content
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

Runtime error on calling resolveAllData from a server component #655

Closed
k0litha opened this issue Oct 13, 2024 · 1 comment
Closed

Runtime error on calling resolveAllData from a server component #655

k0litha opened this issue Oct 13, 2024 · 1 comment

Comments

@k0litha
Copy link

k0litha commented Oct 13, 2024

I'm getting this error when just calling for resolveAllData inside a server component in Next js 13/14:

Unhandled Runtime Error
Error: (0 , _measured_puck__WEBPACK_IMPORTED_MODULE_1__.resolveAllData) is not a function

but I can call this and update all the data inside a client component.
here's how my page look like:

import { Render, resolveAllData } from "@measured/puck";

import config, { UserConfig } from "../../config";

const initialData = {
  root: {
    props: {
      title: "",
    },
  },
  content: [
    {
      type: "Heading",
      props: {
        align: "left",
        text: "Heading",
        padding: "24px",
        size: "m",
        id: "Heading-acf53f80-fd08-4e74-a9c2-7f0a8cb0c225",
      },
    },
    {
      type: "DynamicList",
      props: {
        id: "DynamicList-efa856ce-96e1-441d-a3e9-6ed1047886d1",
        data: [],
      },
    },
  ],
  zones: {},
};

export default async function Client() {
  const resolvedData = await resolveAllData(initialData, config);
  return (
    <>
      <Render<UserConfig> config={config} data={resolvedData} />
    </>
  );
}
@chrisvxd
Copy link
Member

Hey @k0litha, this is fixed in #651 and available in canary under 0.16.2-canary.bf5c5a3.

@chrisvxd chrisvxd closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants