Hi @alex_noel ! Thanks for helping out!
I’ll answer backwards, for simplicity
- Not seeing the error in Studio. Neither in the Studio view, nor in the “preview artboard” preview in the current window nor in the new window one.
hydration-error-info.js:63 Warning: React does not recognize the `setControlContextData` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `setcontrolcontextdata` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
at button
at sS (<anonymous>:125:15280)
at <anonymous>:127:10641
at eaJ (<anonymous>:659:27813)
at span
at n (<anonymous>:573:14547)
at n (<anonymous>:573:18980)
at div
at span
at <anonymous>:593:12625
at eui (<anonymous>:730:31462)
at V (https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:630418)
at section
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at div
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at DataProvider (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:385:19)
at Suspense
at v (<anonymous>:1:959)
, and
index.c00f5b5f.js:2 Warning: Each child in a list should have a unique "key" prop. It was passed a child from DataCtxReader. See https://reactjs.org/link/warning-keys for more information.
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:682868
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at DataProvider (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:385:19)
at div
at CustomDataFetch_ (webpack-internal:///./components/CustomDataFetch.tsx:14:11)
at V (https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:630418)
at section
at section
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at div
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at DataProvider (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:385:19)
at Suspense
at v (<anonymous>:1:959)
, and
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of n which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
at span
at AntdIcon:60:1757
, and
hydration-error-info.js:63 Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
at <anonymous>:2:99742
at <anonymous>:2:101099
at <anonymous>:165:41750
at <anonymous>:193:15986
at <anonymous>:193:25121
at <anonymous>:193:31868
at Fu (<anonymous>:130:28873)
at div
at div
at div
at div
at div
at n (<anonymous>:103:29907)
at <anonymous>:103:30086
at <anonymous>:103:31616
at FP (<anonymous>:130:35280)
at FB (<anonymous>:130:40351)
at n (<anonymous>:130:42268)
at div
at div
at <anonymous>:64:8784
at div
at Tn (<anonymous>:130:56409)
at To (<anonymous>:130:60103)
at uL (<anonymous>:63:48271)
at P5 (<anonymous>:130:22947)
at Ta (<anonymous>:131:11227)
at Tw (<anonymous>:131:12476)
at div
at Ru (<anonymous>:142:9599)
at https://studio.plasmic.app/static/js/index.c00f5b5f.js:2:690511
at DataCtxReader (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:449:23)
at DataProvider (webpack-internal:///./node_modules/@plasmicapp/host/dist/host.esm.js:385:19)
at div
^this one is in the div within my custom component
-
I did run npm install after new imports were needed on Friday. I am collaborating with a non technical teammate and I believe they may have used new components in the project. I usually have a multiplexer running plasmic watch
to keep an eye out on the changes they made, and then I have a makeshift backup by pushing the updates to git. The components in the page I’m testing are the ones that were there previously.
-
Made a duplicate of my project, duplicated the page with my custom data fetching component, ran it with npm run dev
, on a separate terminal ran npm watch -p <project_id>
and started removing elements and refreshing my localhost page. It is an issue with the custom data fetching component since the error stopped showing up after I deleted that component.
The custom component is basically
import * as React from "react";
import { usePlasmicQueryData } from '@plasmicapp/react-web/lib/query';
import { DataProvider } from "@plasmicapp/react-web/lib/host";
function CustomDataFetch_({
url,
endpoint,
children,
className,
dataName
}: {
url?: string,
endpoint?: string,
children: React.ReactNode,
className?: string,
dataName?:string
}
) {
const {data} = url ? usePlasmicQueryData(endpoint, async () => {
const resp = await fetch(url + '' + endpoint);
return await resp.json();
}) : {};
return <div className={className}>
<DataProvider name={dataName} data={data}>
{children}
</DataProvider></div>; }
const CustomDataFetch = React.forwardRef(CustomDataFetch_);
export default CustomDataFetch;
plasmic-host.tsx
import * as React from 'react';
import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
import CustomDataFetch from '../components/CustomDataFetch';
// You can register any code components that you want to use here; see
// https://docs.plasmic.app/learn/code-components-ref/
// And configure your Plasmic project to use the host url pointing at
// the /plasmic-host page of your nextjs app (for example,
// http://localhost:3000/plasmic-host). See
// https://docs.plasmic.app/learn/app-hosting/#set-a-plasmic-project-to-use-your-app-host
// registerComponent(...)
registerComponent(CustomDataFetch, {
name: "CustomDataFetch",
providesData: true,
props: {
// Pass in arbitrary content in the visual editing canvas
children: 'slot',
// Simple scalar props
url: {
type: 'string',
displayName: "URL",
defaultValue: "https://<my-backend-url>"
},
endpoint: {
type: 'string',
displayName: "Endpoint",
defaultValue: "/<my-endpoint>"
},
dataName: {
type: 'string',
displayName: "Data name",
defaultValue: "CustomDataFetch"
}
},
// Specify how generated Plasmic code should import this component;
// path is relative to srcDir
importPath: './components/CustomDataFetch',
});
export default function PlasmicHost() {
return <PlasmicCanvasHost />;
}
(some bits anonymized/redacted)
I’m using Next.js 14.2.20 - there were some issues with Plasmic with newer versions a month or two ago iirc. Let me know if you’d like more info! Or any tips on the custom component above, even if not fully related to this issue. Thanks!