gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

Gatsby Plugin Sharp throws a panic error on running develop #25963

Closed indcoder closed 4 years ago

indcoder commented 4 years ago

Description

The blog was running quite smoothly on my previous WSL 2 distro and after reinstalling the distro and this project on it, when I run the gatsby develop, I get an error that a panic error emanating from the sharp plugin

Steps to reproduce

The project is OSS: https://github.com/MumbaiHackerspace/blog

Expected result

I should get a developer version of the blog

Actual result

Getting a generic panic error on running the gatsby develop command [log tail below]

success write out requires - 0.072s success write out redirect data - 0.012s success Build manifest and related icons - 0.165s success onPostBootstrap - 0.184s ⠀ info bootstrap finished - 7.532s ⠀

ERROR

Cannot read property 'panic' of undefined

TypeError: Cannot read property 'panic' of undefined

not finished run queries - 1.003s not finished Generating image thumbnails - 0.997s

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

System: OS: Linux 4.19 Kali GNU/Linux Rolling 2020.3 CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz Shell: 5.8 - /usr/bin/zsh Binaries: Node: 14.5.0 - ~/.nvm/versions/node/v14.5.0/bin/node Yarn: 1.16.0 - /mnt/c/Program Files (x86)/Yarn/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v14.5.0/bin/npm Languages: Python: 3.8.4 - /usr/bin/python npmPackages: gatsby: ^2.21.37 => 2.22.11 gatsby-image: ^2.4.4 => 2.4.5 gatsby-plugin-feed: ^2.5.1 => 2.5.3 gatsby-plugin-google-analytics: ^2.3.1 => 2.3.2 gatsby-plugin-manifest: ^2.4.5 => 2.4.9 gatsby-plugin-offline: ^3.2.3 => 3.2.7 gatsby-plugin-react-helmet: ^3.3.1 => 3.3.2 gatsby-plugin-sharp: ^2.6.4 => 2.6.9 gatsby-plugin-typography: ^2.5.1 => 2.5.2 gatsby-remark-copy-linked-files: ^2.3.2 => 2.3.3 gatsby-remark-images: ^3.3.4 => 3.3.8 gatsby-remark-prismjs: ^3.5.1 => 3.5.2 gatsby-remark-responsive-iframe: ^2.4.2 => 2.4.3 gatsby-remark-smartypants: ^2.3.1 => 2.3.2 gatsby-remark-vscode: ^2.1.2 => 2.1.2 gatsby-source-filesystem: ^2.3.4 => 2.3.8 gatsby-transformer-remark: ^2.8.9 => 2.8.13 gatsby-transformer-sharp: ^2.5.2 => 2.5.3

vladar commented 4 years ago

Hi @indcoder

I couldn't reproduce this with your project. What I did:

  1. cloned
  2. executed npm install
  3. ran gatsby build

The site was built successfully. Can you please provide steps on how we can reproduce this error?

Also, did you try removing node_modules and re-running npm install after this (as clean install seems to be working fine)?

indcoder commented 4 years ago

I agree, Netlify builds and deploys without a hitch. And I have done the same thing....The only delta is that I have upgraded the Python on the distro to 3.8 and perhaps the oniga-sharp dependency is compiling but something in the sharp plugin is breaking...

Can you suggest any more command to elicit more info?

indcoder commented 4 years ago

This was an issue due to upstream in Python 2.8 and sharp. The latest patch has solved it . Thank you for your help, @vladar . I would request the sharp plugin team to generate a more useful error message instead of a generic panic.

tudor2004 commented 4 years ago

Hey, I am having suddenly the exact same issue. Whenever I try to build on my Mac I am getting "TypeError: Cannot read property 'panic' of undefined". The build works correctly on Netlify.

I have tried removing node_modules, clearing cache, am using the same node version as on netlify. But I still get the error. It's more confusing, as it started happening without me actually updating anything.

System: OS: macOS 10.15.6 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 84.0.4147.105 Safari: 13.1.2 npmPackages: gatsby: ^2.24.11 => 2.24.11 gatsby-cypress: ^0.2.24 => 0.2.24 gatsby-image: ^2.4.13 => 2.4.13 gatsby-plugin-catch-links: ^2.3.11 => 2.3.11 gatsby-plugin-google-tagmanager: ^2.3.11 => 2.3.11 gatsby-plugin-lodash: ^3.3.10 => 3.3.10 gatsby-plugin-manifest: ^2.4.21 => 2.4.21 gatsby-plugin-material-ui: ^2.1.9 => 2.1.9 gatsby-plugin-netlify: ^2.3.11 => 2.3.11 gatsby-plugin-offline: ^2.2.4 => 2.2.4 gatsby-plugin-prefetch-google-fonts: ^1.4.3 => 1.4.3 gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10 gatsby-plugin-react-leaflet: ^2.0.13 => 2.0.13 gatsby-plugin-sass: ^2.3.12 => 2.3.12 gatsby-plugin-sharp: ^2.6.25 => 2.6.25 gatsby-plugin-sitemap: ^2.4.11 => 2.4.11 gatsby-source-filesystem: ^2.3.23 => 2.3.23 gatsby-source-prismic: ^2.2.0 => 2.2.0 gatsby-transformer-sharp: ^2.5.12 => 2.5.12