hashgraph / hedera-metamask-snaps

Metamask snaps offer the ability to create npm package that can be used to enhance the wallet capabilities for chains and DApps.
Apache License 2.0
7 stars 1 forks source link

Getting warnings while starting the hedera-wallet-snap-site #262

Closed kpachhai closed 5 months ago

kpachhai commented 8 months ago

Description

Getting warnings while starting the hedera-wallet-snap-site

Steps to reproduce

  1. yarn start

Then, we see the following warning:


➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:  ERROR #11321  API.NODE.EXECUTION
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: "gatsby-plugin-manifest" threw an error while running the onPostBootstrap
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: lifecycle:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: Something went wrong installing the "sharp" module
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: Cannot find module '../build/Release/sharp-linux-x64.node'
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: Require stack:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: -
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hedera-
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/sharp.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/heder
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: a-wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/constru
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: ctor.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: -
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hedera-
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/index.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/heder
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: a-wallet-snap/node_modules/gatsby-plugin-manifest/safe-sharp.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/heder
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: a-wallet-snap/node_modules/gatsby-plugin-manifest/gatsby-node.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: Possible solutions:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - Install with verbose logging and look for errors: "npm install
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: --ignore-scripts=false --foreground-scripts --verbose sharp"
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - Install for the current linux-x64 runtime: "npm install --platform=linux
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: --arch=x64 sharp"
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: - Consult the installation documentation:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]: https://sharp.pixelplumbing.com/install
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:

➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   Error: Something went wrong installing the "sharp" module
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   Cannot find module '../build/Release/sharp-linux-x64.node'
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   Require stack:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hed
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   era-wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/sha
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   rp.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hed
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   era-wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/con
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   structor.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hed
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   era-wallet-snap/node_modules/gatsby-plugin-manifest/node_modules/sharp/lib/ind
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   ex.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hed
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   era-wallet-snap/node_modules/gatsby-plugin-manifest/safe-sharp.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - /home/kpachhai/repos/github.com/hashgraph/hedera-metamask-snaps/packages/hed
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   era-wallet-snap/node_modules/gatsby-plugin-manifest/gatsby-node.js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   Possible solutions:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - Install with verbose logging and look for errors: "npm install --ignore-scri
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   pts=false --foreground-scripts --verbose sharp"
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - Install for the current linux-x64 runtime: "npm install --platform=linux --a
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   rch=x64 sharp"
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - Consult the installation documentation: https://sharp.pixelplumbing.com/inst
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   all
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - sharp.js:37 Object.<anonymous>
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     [hedera-wallet-snap]/[gatsby-plugin-manifest]/[sharp]/lib/sharp.js:37:9
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1256 Module._compile
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1256:14
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1310 Object.Module._extensions..js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1310:10
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1119 Module.load
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1119:32
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:960 Function.Module._load
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:960:12
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1143 Module.require
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1143:19
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - helpers:119 require
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/helpers:119:18
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - constructor.js:11 Object.<anonymous>
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     [hedera-wallet-snap]/[gatsby-plugin-manifest]/[sharp]/lib/constructor.js:11:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     1
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1256 Module._compile
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1256:14
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1310 Object.Module._extensions..js
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1310:10
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1119 Module.load
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1119:32
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:960 Function.Module._load
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:960:12
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1143 Module.require
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1143:19
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - helpers:119 require
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/helpers:119:18
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - index.js:6 Object.<anonymous>
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     [hedera-wallet-snap]/[gatsby-plugin-manifest]/[sharp]/lib/index.js:6:15
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:   - loader:1256 Module._compile
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:     node:internal/modules/cjs/loader:1256:14
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:
➤ YN0000: [@hashgraph/hedera-wallet-snap-site]:```

### Additional context

_No response_

### Hedera network

other

### Version

v0.2.5

### Operating system

None
poi-son-ivy commented 5 months ago

Core issue is this which happens when compiling sharp from source:

npm error ../metadata.cc:233:46: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
npm error         info.Set("exif", Napi::Buffer<char>::NewOrCopy(env, baton->exif, baton->exifLength, sharp::FreeCallback));
npm error                          ~~~~~~~~~~~~~~~~~~~~^
npm error ../metadata.cc:236:45: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
npm error         info.Set("icc", Napi::Buffer<char>::NewOrCopy(env, baton->icc, baton->iccLength, sharp::FreeCallback));
npm error                         ~~~~~~~~~~~~~~~~~~~~^
npm error ../metadata.cc:239:46: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
npm error         info.Set("iptc", Napi::Buffer<char>::NewOrCopy(env, baton->iptc, baton->iptcLength, sharp::FreeCallback));
npm error                          ~~~~~~~~~~~~~~~~~~~~^
npm error ../metadata.cc:242:45: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
npm error         info.Set("xmp", Napi::Buffer<char>::NewOrCopy(env, baton->xmp, baton->xmpLength, sharp::FreeCallback));
npm error                         ~~~~~~~~~~~~~~~~~~~~^
npm error ../metadata.cc:246:31: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
npm error           Napi::Buffer<char>::NewOrCopy(env, baton->tifftagPhotoshop,
npm error           ~~~~~~~~~~~~~~~~~~~~^

Passing the following env variable (via using export locally, we'll have to adjust the CI build process) fixes it:

SHARP_IGNORE_GLOBAL_LIBVIPS=1