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

Vite crashes on Android #7126

Closed
7 tasks done
FossPrime opened this issue Feb 28, 2022 · 3 comments
Closed
7 tasks done

Vite crashes on Android #7126

FossPrime opened this issue Feb 28, 2022 · 3 comments

Comments

@FossPrime
Copy link

FossPrime commented Feb 28, 2022

Update: The issue is esbuild has a binary and supports Android, but it does not make a build for Intel based Android, so it both requires the binary code and can't provide it.


Describe the bug

vite build crashes on android with the following error:

npx vite build
failed to load config from /data/data/com.termux/files/home/my-app/vite.config.ts
error during build:
Error: Unsupported platform: android x64 LE
    at pkgAndSubpathForCurrentPlatform (/data/data/com.termux/files/home/my-app/node_modules/esbuild/lib/main.js:1621:11)
    at generateBinPath (/data/data/com.termux/files/home/my-app/node_modules/esbuild/lib/main.js:1633:28)
    at esbuildCommandAndArgs (/data/data/com.termux/files/home/my-app/node_modules/esbuild/lib/main.js:1699:11)
    at ensureServiceIsRunning (/data/data/com.termux/files/home/my-app/node_modules/esbuild/lib/main.js:1856:25)
    at Object.build (/data/data/com.termux/files/home/my-app/node_modules/esbuild/lib/main.js:1749:26)
    at bundleConfigFile (/data/data/com.termux/files/home/my-app/node_modules/vite/dist/node/chunks/dep-f5552faa.js:75118:34)
    at loadConfigFromFile (/data/data/com.termux/files/home/my-app/node_modules/vite/dist/node/chunks/dep-f5552faa.js:75095:35)
    at resolveConfig (/data/data/com.termux/files/home/my-app/node_modules/vite/dist/node/chunks/dep-f5552faa.js:74656:34)
    at doBuild (/data/data/com.termux/files/home/my-app/node_modules/vite/dist/node/chunks/dep-f5552faa.js:37652:26)
    at build (/data/data/com.termux/files/home/my-app/node_modules/vite/dist/node/chunks/dep-f5552faa.js:37640:22)

Reproduction

vite.new/vue-ts

System Info

$ npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
  System:
    OS: android
    CPU: Unknown
    Memory: 293.26 MB / 6.44 GB
  Binaries:
    Node: 16.13.2 - /data/data/com.termux/files/usr/bin/node
    npm: 8.1.2 - /data/data/com.termux/files/usr/bin/npm
  npmPackages:
    vite: ^2.7.13 => 2.7.13

Used Package Manager

npm

Logs

No response

Validations

@Niputi
Copy link
Contributor

Niputi commented Feb 28, 2022

error message says esbuild doesn't offer any android binaries.

create a issue with a reproduction at esbuild repository

@Niputi Niputi closed this as completed Feb 28, 2022
@FossPrime
Copy link
Author

FossPrime commented Feb 28, 2022

Got it thank you. I posted the issue at evanw/esbuild#2068

P.S. swc now compiles to WASM. Perhaps defaulting to esbuild-wasm would be ideal. I thought sass-loader was the last binary we'd have to deal with in node projects.

@FossPrime
Copy link
Author

Fixed upstream. Just delete the lockfile to get the latest esbuild.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants