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

Cannot find module 'undefinedbuild/Release/sharp-win32-x64.node' #3119

Open
3 tasks done
piedpie opened this issue Dec 24, 2022 · 3 comments
Open
3 tasks done

Cannot find module 'undefinedbuild/Release/sharp-win32-x64.node' #3119

piedpie opened this issue Dec 24, 2022 · 3 comments

Comments

@piedpie
Copy link

piedpie commented Dec 24, 2022

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.4

Electron version

22.0.0

Operating system

Windows 10

Last known working Electron Forge version

No response

Expected behavior

Should be able to use the venom-bot methods, venom-bot uses sharp
and then run and package the app

Actual behavior

After adding the venom-bot package when I call the venom-package methods it throws following error:


App threw an error during load
Error: 
Something went wrong installing the "sharp" module

Cannot find module 'undefinedbuild/Release/sharp-win32-x64.node'
Require stack:
- C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js
- C:\Users\admin\Desktop\forge-sharp-example\node_modules\electron\dist\resources\default_app.asar\main.js
-

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at ./node_modules/sharp/lib/sharp.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:42357:9)
    at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
    at ./node_modules/sharp/lib/constructor.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:38511:1)
    at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
    at ./node_modules/sharp/lib/index.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:38903:15)
    at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85    at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)
    at ./node_modules/venom-bot/dist/api/helpers/index.js (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:49577:24)
    at __webpack_require__ (C:\Users\admin\Desktop\forge-sharp-example\.webpack\main\index.js:85802:42)

Steps to reproduce

I have added a sample repo:

Visit https://github.com/piedpie/forge-sharp-example
Clone the repo and run

npm install

npm start

Additional information

I already tried following:

  • Install with verbose logging and look for errors:
    npm install --ignore-scripts=false --foreground-scripts --verbose sharp

  • Install for the current win32-x64 runtime:
    npm install --platform=win32 --arch=x64 sharp

  • Aso deleted node_modules and tried
    npm install sharp --ignore-scripts false

@erickzhao
Copy link
Member

This sounds like an issue with renderer sandboxing in Electron 22, which is where the undefined in that path is coming from. You can get past that with sandbox: false in your BrowserWindow.

As an aside, there's a separate issue with certain native modules like Sharp which might require you to stick to Electron 20 for now: electron/electron#35801

@sibelius
Copy link

related to vercel/webpack-asset-relocator-loader#161

and #3258

@Deestar
Copy link

Deestar commented Sep 18, 2023

I am having this issue also windows 10? any luck?

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

3 participants