Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn Error persisting state: function imageAttributes() #29059

Closed
EmaProv opened this issue Jan 17, 2021 · 4 comments
Closed

warn Error persisting state: function imageAttributes() #29059

EmaProv opened this issue Jan 17, 2021 · 4 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@EmaProv
Copy link

EmaProv commented Jan 17, 2021

Hi everyone,
sice I switch from .md to .mdx, this warn came to me every time I try to develop or build my gatsby project.

warn Error persisting state: function imageAttributes() { if (isRemarkParser(this.Parser)) { const parser = this.Parser.prototype; ...<omitted>... } could not be cloned.

Someone has ever had the same issue??

My Clipboard:

System:
OS: Windows 10 10.0.18363
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Binaries:
Node: 14.4.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.8.2 - /c/Users/emapr/AppData/Local/Programs/Python/Python38/python
Browsers:
Chrome: 87.0.4280.141
Edge: Spartan (44.18362.449.0)
npmPackages:
gatsby: ^2.30.3 => 2.30.3
gatsby-awesome-pagination: ^0.3.6 => 0.3.6
gatsby-image: ^2.9.0 => 2.9.0
gatsby-plugin-catch-links: ^2.8.0 => 2.8.0
gatsby-plugin-manifest: ^2.10.0 => 2.10.0
gatsby-plugin-mdx: ^1.8.0 => 1.8.0
gatsby-plugin-offline: ^3.8.0 => 3.8.0
gatsby-plugin-react-helmet: ^3.8.0 => 3.8.0
gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
gatsby-plugin-sharp: ^2.12.2 => 2.12.2
gatsby-remark-image-attributes: ^0.2.8 => 0.2.8
gatsby-remark-images: ^3.9.0 => 3.9.0
gatsby-source-filesystem: ^2.9.1 => 2.9.1
gatsby-transformer-sharp: ^2.10.1 => 2.10.1
npmGlobalPackages:
gatsby-cli: 2.17.1

@EmaProv EmaProv added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 17, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 17, 2021
@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 18, 2021
@LekoArts
Copy link
Contributor

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 💜

@EmaProv
Copy link
Author

EmaProv commented Jan 18, 2021

Yep I'll go for it and edit the post! The problem is that I don't know where the issue is, because my site works well. It console log this warn during the develop - build process.
I'll edit soon!

@flikteoh
Copy link

Likely similar to #28279, this has provided a solution for me at the moment.

@EmaProv
Copy link
Author

EmaProv commented Jan 20, 2021

Oh thanks the warn has gone using this method: I install the standard remark-images package and just added it as remarkPugins.

BEFOR:

{
      resolve: `gatsby-plugin-mdx`,
      options: {
        defaultLayouts: {
          posts: require.resolve("./src/templates/blog-post.js"),
          default: require.resolve("./src/components/layout.js"),
        },
        extensions: [`.mdx`, `.md`],
        gatsbyRemarkPlugins: [
          {
            resolve: `gatsby-remark-images`,
            options: {
              maxWidth: 850,
              withWebp: true,
            },
          },
        ]
      },
    },

AFTER:

{
      resolve: `gatsby-plugin-mdx`,
      options: {
        defaultLayouts: {
          posts: require.resolve("./src/templates/blog-post.js"),
          default: require.resolve("./src/components/layout.js"),
        },
        extensions: [`.mdx`, `.md`],
        remarkPlugins: [
          require('remark-images'),
        ],
        gatsbyRemarkPlugins: [
          {
            resolve: `gatsby-remark-images`,
            options: {
              maxWidth: 850,
              withWebp: true,
              /* wrapperStyle: fluidResult => `flex:${_.round(fluidResult.aspectRatio, 2)};`, */
            },
          },
        ]
      },
    },

Hopes it will be stable!
Thank you all!!

@EmaProv EmaProv closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants