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

Gatsby Plugin Sharp error after upgrading to v3.10.0 #32445

Closed
2 tasks done
t2ca opened this issue Jul 20, 2021 · 4 comments · Fixed by #32459
Closed
2 tasks done

Gatsby Plugin Sharp error after upgrading to v3.10.0 #32445

t2ca opened this issue Jul 20, 2021 · 4 comments · Fixed by #32459
Assignees
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: media Related to gatsby-plugin-image, or general image/media processing topics type: bug An issue or pull request relating to a bug in Gatsby

Comments

@t2ca
Copy link
Contributor

t2ca commented Jul 20, 2021

Preliminary Checks

Description

I am having the following error once I upgraded to Gatsby v3.10.0

In development when navigating to a page with images.

Cannot read property 'del' of undefined

  TypeError: Cannot read property 'del' of undefined

  - gatsby-node.js:72
    /[gatsby-plugin-sharp]/gatsby-node.js:72:23

Reproduction Link

n/a

Steps to Reproduce

  1. Upgrade to v3.10.0
  2. gatsby develop
  3. Navigate to page with images

Expected Result

No error

Actual Result

Cannot read property 'del' of undefined

  TypeError: Cannot read property 'del' of undefined

  - gatsby-node.js:72
    /[gatsby-plugin-sharp]/gatsby-node.js:72:23

Temporary Fix

Open node_modules/gatsby-plugin-sharp/gatsby-node.js

Replace lines 72 - 80 with the following:

    await cache?.cache?.del(decodedURI);

    if (jobWithRemainingOperations.args.operations.length > 0) {
      // There are still some operations pending for this job - replace the cached job
      await cache?.cache?.set(jobContentDigest, jobWithRemainingOperations);
    } else {
      // No operations left to process - purge the cache
      await cache?.cache?.del(jobContentDigest);
    }

@t2ca t2ca added the type: bug An issue or pull request relating to a bug in Gatsby label Jul 20, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 20, 2021
@hendra-go
Copy link
Contributor

confirmed. I experienced it too.

@LekoArts LekoArts added topic: media Related to gatsby-plugin-image, or general image/media processing topics 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 Jul 21, 2021
@LekoArts
Copy link
Contributor

LekoArts commented Jul 21, 2021

Hi!

Please provide a minimal reproduction as asked for in the issue template.

I used npm init gatsby temp -y, updated to [email protected] and installed gatsby-plugin-sharp, gatsby-transformer-sharp and used this one the index page:

import * as React from "react"
import { graphql } from "gatsby"

const pageStyles = {
  color: "#232129",
  padding: 96,
  fontFamily: "-apple-system, Roboto, sans-serif, serif",
}

const IndexPage = ({ data }) => {
  return (
    <main style={pageStyles}>
      <title>Home Page</title>
      <h1>Test Page</h1>
      <img alt="" src={data.imageSharp.gatsbyImageData.images.fallback.src} />
    </main>
  )
}

export default IndexPage

export const query = graphql`
  query {
    imageSharp {
      gatsbyImageData
    }
  }
`

I didn't see any errors during gatsby develop or gatsby build. Please provide a reproduction, thanks!

@pieh pieh self-assigned this Jul 21, 2021
@pieh
Copy link
Contributor

pieh commented Jul 21, 2021

This seems to happen when gatsby develop is used with LMDB_STORE flag and visiting dev site that would trigger lazy image processing. Was able to reproduce locally, will start working on a fix.

@LekoArts
Copy link
Contributor

Fixed in [email protected] and [email protected]

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. topic: media Related to gatsby-plugin-image, or general image/media processing topics type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants