Rawan
Rawan

Reputation: 63

Gatsby Error persisting state: function could not be cloned

Recently I have migrated from Gatsby V2 to V4, using the official docs since that Iam facing this warning and It goes like this,

warn Error persisting state: function createFolder(folderData) {
    return client.mutate({
      mutation: mutations.createFo...<omitted>... } could not be cloned.

Iam using node version : 14.15.4 and npm version : 6.14.10

Is anybody faced this error before or suggest any way to resolve this.

Upvotes: 0

Views: 229

Answers (1)

Ferran Buireu
Ferran Buireu

Reputation: 29320

I'd suggest updating your npm version up to version 7 in order to run:

npm install gatsby@latest --legacy-peer-deps

As well:

npm outdated

To compare your wanted version to the latest.

Keep in mind that if some dependency is not updated to any accordingly working version, your project may not be able to run. However, in the case of the gatsby-plugin-sharp, being an official maintained plugin I guess it will be compatible with v3 (they just shipped the v4 recently so...).

Prior to that suggestions, I'd also recommend cleaning cache in each process as well reinstalling your dependencies (or the locked ones) removing your node_modules, your package-lock.json, etc if needed.

Share you configuration details (gatsby-config.js) to see if there's something that needs to be refactored in the version 3.

Upvotes: 1

Related Questions