Getting lots of type errors and not sure why. If I remove required: true
from the slot
s it works, however other things seem wrong like providesData
not working.
Anyone seen this and solved it?
Is there a chance the types changed?
Getting lots of type errors and not sure why. If I remove required: true
from the slot
s it works, however other things seem wrong like providesData
not working.
Anyone seen this and solved it?
Is there a chance the types changed?
Builds seem to be working on the server side, so not sure if there is something wonky client side for me. Restarting my TS server didn’t fix it
"@plasmicapp/loader-nextjs": "^1.0.142",
Yeah Can you upgrade to latest? (1.0.182)
1.0.142 did not support things like providesData
what the…
PLASMIC?.registerComponent(PCPProductCatalog, {
name: 'PCPProductCatalog',
providesData: true,
props: {
catalogHeading: {
type: 'slot',
required: true,
allowedComponents: ['PCPCatalogHeading'],
defaultValue: [
{
type: 'component',
name: 'PCPCatalogHeading',
props: {},
},
],
},
productGrid: {
type: 'slot',
required: true,
allowedComponents: ['PCPProductGrid'],
defaultValue: [
{
type: 'component',
name: 'PCPProductGrid',
props: {},
},
],
},
},
})
on providesData
Hmmm, what type error are you getting?
No overload matches this call.
Overload 2 of 2, '(component: ({ className, catalogHeading, productGrid, }: { className?: string | undefined; catalogHeading: Element; productGrid: Element; }) => Element | null, name: ComponentLookupSpec): void | undefined', gave the following error.
Argument of type '{ name: string; providesData: boolean; props: { catalogHeading: { type: string; required: boolean; allowedComponents: string[]; defaultValue: { type: string; name: string; props: {}; }[]; }; productGrid: { ...; }; }; }' is not assignable to parameter of type 'ComponentLookupSpec'.
Object literal may only specify known properties, and 'providesData' does not exist in type '{ name: string; projectId?: string | undefined; isCode?: boolean | undefined; }'.ts(2
This is also erroring until I remove required: true
PLASMIC?.registerComponent(PDPAddToCartRegion, {
name: 'PDPAddToCartRegion',
props: {
addToCartButton: {
type: 'slot',
required: true,
isRepeated: false,
allowedComponents: ['AddToCartButton'],
defaultValue: {
type: 'component',
name: 'AddToCartButton',
props: {},
},
},
},
})
Can you check which version is in node_modules/@plasmicapp/host/package.json?
1.0.78 it seems
Weird. That is latest, so providesData
should work. Can you try re-starting your IDE?
i did that, gonna try my whole computer to be safe lol
You can also ctrl+click registerComponent to see the type it is expecting