Slice machine integration field

Hello :slight_smile:

I am using Prismic with a Nextjs project with Slicemachine. Integration fields doesn't seem to be supported yet (correct me if I am wrong), so I created my slice using integration fields directly in the prismic dahsboard.

Is there a way for me to create a variation of that slice and add a custom preview image by any chance? I can't figure it out.

Thanks a lot :pray:

Hello @romain

Thanks for reaching out to us.

Yes, it's true that you can't add IF to the SM for the moment. Our SM team is working on adding Integration Fields to the SliceMachine.

In the meantime, there is a workaround that you can use. You can add the Integration Field inside the model.json file of a Slice. This will allow you to push your Slice with Integration Field to the Prismic UI.

The drawback of this workaround is that this field will not be usable in the SliceMachine UI (it won't be editable, will appear as "Field type "IntegrationFields" not supported", and it won't be populated with dummy data for preview and screenshots).

When we release SliceMachine support for Integration Fields, we'll communicate it publicly on our progress page: What's new - Prismic

Let me know if you have any questions about this.

Thanks,
Priyanka

1 Like

@Priyanka This worked for me - however I updated to the new slicemachine and now i'm getting:

[slice-machine] Could not parse model Collection
Full error: Error: Invalid Paths:
        PATH: |0|/variations|0||1|/items/product|0|/type|0|
        VALUE: "IntegrationFields"

        PATH: |0|/variations|0||1|/items/product|0|/type|1|
        VALUE: "IntegrationFields"

my model looks like this:

      "items": {
        "product": {
          "type": "IntegrationFields",
          "config": {
            "catalog": "wondervalley--shopify",
            "label": "Product"
          }
        }
      }

any pointers would be great

Hello @beamer

I am experiencing the same issue with the Integration field. I will let my team know about the issue and return it to you. Meanwhile, please use previous versions to keep using integration fields.

Thanks,
Priyanka

I'm not sure why but reverting back to older version (0.1.2) now doesn't work? Not sure what it is I've been poking at it for a bit with no luck.

$ start-slicemachine --verbose
/Users/me/GitHub/wv/node_modules/@slicemachine/core/build/src/utils/framework.js:32
    const frameworkEntry = Object.values(supportedFrameworks).find((f) => deps[f] && deps[f].length);
                                  ^

TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at detectFramework (/Users/me/GitHub/wv/node_modules/@slicemachine/core/build/src/utils/framework.js:32:35)
    at Object.defineFramework (/Users/me/GitHub/wv/node_modules/@slicemachine/core/build/src/utils/framework.js:44:36)
    at run (/Users/me/GitHub/wv/node_modules/slice-machine-ui/start/index.js:162:37)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
1 Like

Hello @beamer

Can you please paste packege.json file here?

Thanks,
Priyanka

Hello @beamer

I have got an update from the team that you can update the slice machine version to alpha. It seems to be working with the integration field:

npm i slice-machine-ui@alpha

Let me know if you have any questions.

Thanks,
Priyanka

2 posts were split to a new topic: Integration Field with Slice Machine