expo / expo-webpack-integrations

Packages used to integrate Expo in Webpack-based projects.
8 stars 1 forks source link

expo-pwa: error on splash: "w and h must be numbers" #7

Open ezekiel747 opened 3 years ago

ezekiel747 commented 3 years ago

Hi, i'm trying to generate splash screens with the following command - but i get the error below:

expo-pwa splash --color '#40714b' --resize contain -i ./raw/image512large.png

Using node to generate images. This is much slower than using native packages. › Optionally you can stop the process and try again after successfully running npm install -g sharp-cli.

Aborting run An unexpected error was encountered. Please report it as a bug: Error: w and h must be numbers at Jimp.throwError (/usr/local/lib/node_modules/expo-pwa/node_modules/@jimp/utils/dist/index.js:33:13) ...

expo-pwa version 0.0.82 The image i want to use as input seems fine, it's 512 x 512 px, i've already succesfully used it to generate icons (with expo-pwa icon -i ...)

ezekiel747 commented 3 years ago

After installing sharp-cli globally as recommended in the output posted in previous message, i get a different error:

expo-pwa splash --color '#40714b' --resize cover -i assets/splash-pwa.png

Aborting run An unexpected error was encountered. Please report it as a bug: Error: It was not possible to generate splash screen 'assets/splash-pwa.png'. Cannot use 'in' operator to search for 'alpha' in true at resizeAsync (/usr/local/lib/node_modules/expo-pwa/node_modules/@expo/image-utils/build/Image.js:99:15

As a temporary solution: to get the splash images, i used instead expo build:web, then copied over the resulted images from the resulted "web-build" folder. I took a look at the way those get generated - but it seems there's a different method there, not by using expo-pwa commands directly: https://github.com/expo/expo-cli/blob/bc725a634d950ad0068828bcae8579881d66ee75/packages/webpack-config/src/plugins/ApplePwaWebpackPlugin.ts#L105

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.