You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to install, build, and run the Optic code as per the Developer Setup doc. I have an Apple M1 and got two different errors related to the platform.
Error with wasm-pack
When running yarn install, I received this error below which pertains to this issue.
error /.../optic/node_modules/wasm-pack: Command failed.
Exit code: 1
Command: node ./install.js
Arguments:
Directory: /.../optic/node_modules/wasm-pack
Output:
/.../optic/node_modules/wasm-pack/binary.js:19
throw new Error(`Unsupported platform: ${type} ${arch}`);
^
Error: Unsupported platform: Darwin arm64
at getPlatform (/.../optic/node_modules/wasm-pack/binary.js:19:9)
at getBinary (/.../optic/node_modules/wasm-pack/binary.js:23:20)
at install (/.../optic/node_modules/wasm-pack/binary.js:37:18)
at Object.<anonymous> (/.../optic/node_modules/wasm-pack/install.js:4:1)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
To fix, I did the following:
Removed the wasm-pack dev dependency in the packages.json
Installed wasm-pack with cargo install wasm-pack
Reran yarn install
Error with wasm-opt
When running optic_build, I the following issue.
| [INFO]: Installing wasm-bindgen...
| Error: no prebuilt wasm-opt binaries are available for this platform: Unrecognized target!
| To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
| npm ERR! code 1
| npm ERR! path /.../optic/workspaces/diff-engine-wasm
| npm ERR! command failed
| npm ERR! command sh -c cd engine && wasm-pack build --target nodejs --out-dir build --out-name index
I followed the suggestion in the error response and added wasm-opt = false to my package metadata. This fixed the issue and I was able to run optic_build, optic_watch, and yarn start-local.
The text was updated successfully, but these errors were encountered:
Hey @smizell, thanks for posting the issue. I also occasionally develop Optic on an M1 Mac (as the only one of the Optic team so far) and have found the exact same problem as you did, using the exact same workarounds.
Both problems stem from there being no prebuilt binary published for Darwin-aarch64. There are issues and a PR that should fix that, but it's hard to say how long that's going to take to get merged. Ever since the October last year the project has seen a build up of a backlog with little activity (connected to lay-offs at Mozilla perhaps?). Once these binaries are published, installing wasm-pack through NPM / Yarn should work just fine.
With that in mind, I reckon sticking with the workaround is the way to go for at least a while.
I was trying to install, build, and run the Optic code as per the Developer Setup doc. I have an Apple M1 and got two different errors related to the platform.
Error with
wasm-pack
When running
yarn install
, I received this error below which pertains to this issue.To fix, I did the following:
wasm-pack
dev dependency in thepackages.json
wasm-pack
withcargo install wasm-pack
yarn install
Error with
wasm-opt
When running
optic_build
, I the following issue.I followed the suggestion in the error response and added
wasm-opt = false
to my package metadata. This fixed the issue and I was able to runoptic_build
,optic_watch
, andyarn start-local
.The text was updated successfully, but these errors were encountered: