Unable to upload screenshot with status code: 400

Hi, we are trying to push several custom type and slices changes to prismic using the slice machine. However, every time we click on the "Push to Prismic" button we get the following error on the console:

 An error happened while pushing your changes
Error: Unable to upload screenshot with status code: 400
    at ScreenshotsManager.uploadScreenshot

Dependencies:

"@prismicio/client": "^7.0.0",
"@prismicio/next": "^0.1.5",
"@prismicio/react": "^2.5.0",
"@prismicio/slice-simulator-react": "^0.2.3",

devDependencies:

"@slicemachine/adapter-next": "^0.3.5",
"prismic-ts-codegen": "^0.1.11",
"slice-machine-ui": "^1.5.2",

We can confirm that every slice has a png screenshot except for one without screenshots.

Hello @consumerproduct

Thanks for reaching out to us.

I need to know the node and npm versions before escalating it to my dedicated team. Can you tell me the versions?

Thanks,
Priyanka

Hello, sure, the node version is: v16.13.1 and the npm version is: 8.2.0.

Thanks!

Hello @consumerproduct

I can not reproduce the issue. Can you try to update node v18, and the npm version is 9.6.4?

Give this a try, and let me know if it still doesn't work for you.

Thanks,
Priyanka

Hi @Priyanka thanks for your answer, We tried pushing the changes using node v18 and got the same error.

Node version: 18.17.0
npm version: 9.6.7

We deleted the node_modules folder and ran npm install again after the change, ran slice machine and clicked on the "Push Changes" button, however we got the same error message:

An error happened while pushing your changes
Error: Unable to upload screenshot with status code: 400
    at ScreenshotsManager.uploadScreenshot

dependencies:

"@prismicio/client": "^7.0.0",
"@prismicio/next": "^0.1.5",
"@prismicio/react": "^2.5.0",
"@prismicio/slice-simulator-react": "^0.2.3",
"next": "^12.3.0",
"react": "^18.2.0",

devDependencies

"@slicemachine/adapter-next": "^0.3.6",
"prismic-ts-codegen": "^0.1.11",
"slice-machine-ui": "^1.5.3",

Hello Nick,

I started a new Next.js project with the Slice Machine, and I can not reproduce the issue. I am successfully able to push slices and custom types. These are my dependencies and devDependencies:

Can you try to upgrade all the dependencies? @prismicio/slice-simulator-react is deprecated. You can remove it.

Thanks,
Priyanka