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

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

Open
ezekiel747 opened this issue Jun 6, 2021 · 2 comments
Open

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

ezekiel747 opened this issue Jun 6, 2021 · 2 comments
Assignees

Comments

@ezekiel747
Copy link

ezekiel747 commented Jun 6, 2021

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
Copy link
Author

ezekiel747 commented Jun 7, 2021

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

@EvanBacon EvanBacon self-assigned this Aug 22, 2021
@github-actions
Copy link

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.

@byCedric byCedric transferred this issue from expo/expo-cli Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants